added empty list test

This commit is contained in:
2024-02-24 17:31:44 +01:00
parent 2435f272c0
commit cb6b6c26b4

View File

@ -109,7 +109,7 @@ def test_price_calc():
@pytest.mark.dependency(depends=[Task.A]) @pytest.mark.dependency(depends=[Task.A])
@pytest.mark.timeout(10) @pytest.mark.timeout(10)
@eidp_test("`articles`/`cart` wird verwendet", -2, Task.A) @eidp_test("`articles`/`cart` wird verwendet", -2, Task.A)
def test_sideeffectss(): def test_sideeffectss_price_calc():
a = {'Coke': 200, 'Eis': 350} a = {'Coke': 200, 'Eis': 350}
b = {'Coke': 2, 'Eis': 3} b = {'Coke': 2, 'Eis': 3}
calculate_price(a2 := deepcopy(a), b2 := deepcopy(b)) 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 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__': if __name__ == '__main__':
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
prog='ex2_dictionary.py test', prog='ex2_dictionary.py test',