Example #1
0
def test_get_min_age_return_none():
    jenny = Vendor(
        inventory=[]
    )

    result = jenny.get_min_age()

    assert result == None
Example #2
0
def test_get_min_age():
    item_a = Clothing(age = 1)
    item_b = Clothing(age = 4)
    item_c = Decor(age = 2)
    item_d = Decor(age = 3.5)
    tai = Vendor(inventory = [item_a,item_b,item_c, item_d])
    newest_item = tai.get_min_age()
    
    assert newest_item.age == 1
Example #3
0
def test_get_min_age():
    item_a = Decor(condition=3.5)
    item_b = Electronics(condition=3.5)
    item_c = Clothing(condition=3.5, age=9.0)
    item_d = Item(condition=3.5, age=1.0)
    item_e = Clothing(condition=3.5, age=6.0)

    kate = Vendor(
        inventory=[item_a, item_b, item_c, item_d, item_e]
    )

    result = kate.get_min_age()

    assert result.category == "Electronics"
    assert result.age == pytest.approx(0.0)