Example #1
0
def test_after_unknown_product_recalculations():
    recalculate_quality(pasta)
    recalculate_quality(pasta1)
    assert pasta.quality == 1
    #    inmmutable cause no if statements
    assert pasta1.quality == 20
    assert pasta2.quality == 5
Example #2
0
def test_after_one_potato_recalculations():
    recalculate_quality(potato)
    recalculate_quality(potato1)
    recalculate_quality(potato2)
    assert potato.quality == 9.5
    assert potato1.quality == 99.5
    assert potato2.quality == 0
Example #3
0
def test_after_unknown_product_recalculation_bellow_zero():
    recalculate_quality(pasta)
    assert pasta.quality == -2
Example #4
0
def test_after_two_cheese_recalculations():
    recalculate_quality(cheese)
    recalculate_quality(cheese1)
    assert cheese.quality == 6
    assert cheese1.quality == 96
Example #5
0
def test_lessthan5_recalculation1():

    recalculate_quality(ham)
    assert ham.quality == 1
Example #6
0
def test_after_one_cheese_recalculations():
    recalculate_quality(cheese)
    recalculate_quality(cheese1)
    assert cheese.quality == 8
    assert cheese1.quality == 98
Example #7
0
def test_after_two_potato_recalculations():
    recalculate_quality(potato)
    recalculate_quality(potato1)
    assert potato.quality == 9
    assert potato1.quality == 99
Example #8
0
def test_defined_product():

    recalculate_quality(potatoe)
    assert potatoe.quality == 9.5
Example #9
0
def test_zero_quality_product():

    recalculate_quality(carrot)
    assert carrot.quality == 0