コード例 #1
0
def test_buy_product_with_insufficient_funds():
    """
    test buy product with insufficient funds
    """
    machine = vending_machine.VendingMachine()
    dime = coins.Dime()
    nickel = coins.Nickel()
    machine.insert_coin(dime)
    machine.insert_coin(nickel)
    drink = products.Drink()
    with pytest.raises(InsufficientFunds):
        machine.buy_product(drink)
コード例 #2
0
def test_drink_str():
    """test drink str"""
    drink = products.Drink()
    assert str(drink) == "Drink: $2.75"
コード例 #3
0
def test_drink_str():
    drink = products.Drink()
    assert str(drink) == 'Drink: $2.75'
コード例 #4
0
def test_drink_price():
    """test drink price"""
    drink = products.Drink()
    assert drink.price == 275
コード例 #5
0
def test_drink_price():
    drink = products.Drink()
    assert drink.price == 275