コード例 #1
0
def test_check_burger_invalid():
    main = Main('burger')
    bun = QuantityIngredient(1, 'bun','m', 10, 1.5)
    main.addIngredient(bun, 1, None)
    with pytest.raises(UserError) as err:
        main.checkBurger()
    assert  "You must finish your burger before moving on. It needs at least 2 buns to be finished." in str(err.value)
コード例 #2
0
def test_check_burger_valid():
    main = Main('burger')
    bun = QuantityIngredient(1, 'bun','m', 10, 1.5)
    main.addIngredient(bun, 2, None)
    assert main.checkBurger() == True