コード例 #1
0
def test_several_awards():
    award1 = Normal(expires_in=5, quality=10)
    award2 = BlueFirst(expires_in=3, quality=10)
    award1.update_quality()
    award2.update_quality()

    assert award1.quality == 9
    assert award1.expires_in == 4
    assert award2.quality == 11
    assert award2.expires_in == 2
コード例 #2
0
def test_normal_award(initial_expires_in, initial_quality, expected_quality):

    award = Normal(expires_in=initial_expires_in, quality=initial_quality)
    award.update_quality()
    assert award.expires_in == initial_expires_in - 1
    assert award.quality == expected_quality