def test_remIngredient_incorrectinput(): sys = System() sys.addQuantityIngredient('sesame bun', 'm', 20, 1.00) with pytest.raises(DevError) as err: sys.remIngredient(1) assert 'cannot delete. no such ingredient in the inventory' in str( err.value)
def test_remIngredient_correctinput(): sys = System() sys.addQuantityIngredient('sesame bun', 'm', 20, 1.00) sys.addWeightIngredient('fries', 'm', 2000, 60, 100, 140, 2, 2.8, 3.4) sys.remIngredient(4) assert len(sys.ingredients) == 1 assert sys.ingredients[0].name == 'sesame bun'