added empty list test
This commit is contained in:
@ -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',
|
||||
|
Reference in New Issue
Block a user