def test_view_order(inventory_fixture, ingredient_cost_fixture):
    system1 = System(inventory_fixture, ingredient_cost_fixture)
    assert (isinstance(system1, System))
    order1 = system1.Create_Order()
    assert (isinstance(order1, Order))

    burg1 = order1.Create_Item("Burger")
    burg1.Bun_Type = "white"
    burg1.Add_Bun()
    burg1.Add_Bun()
    burg1.Patty_Type = "beef"
    burg1.Add_Patty()
    burg1.Add_Other("cheese")
    order1.Add_To_Order(burg1)

    try:
        system1.View_Order(order1.ID)
    except SystemError as err:
        assert (err.message == "Order not found.")
    else:
        assert (False)

    system1.Submit_Order(order1)
    assert (system1.View_Order(order1.ID) == order1)

    system1.Preparing_Order(order1)
    assert (system1.View_Order(order1.ID) == order1)

    system1.Complete_Order(order1)
    assert (system1.View_Order(order1.ID) == order1)
Beispiel #2
0
def test_OrderID_not_found(inventory_fixture, ingredient_cost_fixture):
    system1 = System(inventory_fixture, ingredient_cost_fixture)
    assert (isinstance(system1, System))
    with pytest.raises(SystemError) as err:
        order = system1.View_Order(1)
    assert (err)