コード例 #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
コード例 #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
コード例 #3
0
def test_after_unknown_product_recalculation_bellow_zero():
    recalculate_quality(pasta)
    assert pasta.quality == -2
コード例 #4
0
def test_after_two_cheese_recalculations():
    recalculate_quality(cheese)
    recalculate_quality(cheese1)
    assert cheese.quality == 6
    assert cheese1.quality == 96
コード例 #5
0
def test_lessthan5_recalculation1():

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

    recalculate_quality(potatoe)
    assert potatoe.quality == 9.5
コード例 #9
0
def test_zero_quality_product():

    recalculate_quality(carrot)
    assert carrot.quality == 0