diff --git a/src/test_dictionary.py b/src/test_dictionary.py index c932d24..bd409ab 100644 --- a/src/test_dictionary.py +++ b/src/test_dictionary.py @@ -109,7 +109,7 @@ def test_price_calc(): @pytest.mark.dependency(depends=[Task.A]) @pytest.mark.timeout(10) @eidp_test("`articles`/`cart` wird verwendet", -2, Task.A) -def test_sideeffectss(): +def test_sideeffectss_price_calc(): a = {'Coke': 200, 'Eis': 350} b = {'Coke': 2, 'Eis': 3} calculate_price(a2 := deepcopy(a), b2 := deepcopy(b)) @@ -155,6 +155,22 @@ def test_sideeffects_by_amount(): assert a2 == a and b2 == b and r is not a and r is not b +@pytest.mark.dependency(depends=[Task.A]) +@pytest.mark.timeout(10) +@eidp_test("leere Dictionaries werden nicht beachtet", -2, Task.A) +def test_empty_dics_calc_price(): + from ex2_dictionary import calculate_price + assert abs(calculate_price({}, {})) < EPS + + +@pytest.mark.dependency(depends=[Task.B]) +@pytest.mark.timeout(10) +@eidp_test("leere Dictionaries werden nicht beachtet", -2, Task.B) +def test_empty_dics_by_amount(): + from ex2_dictionary import by_amount + assert by_amount({}, {}) == {} + + if __name__ == '__main__': parser = argparse.ArgumentParser( prog='ex2_dictionary.py test',