Exemple #1
0
def test_delivery_get_all_requestIDs_can_handle_deliveries_without_requests():
    mabd = MABD()

    delivery2 = mabd.get_delivery_by_number(2)
    requestIDs = delivery2.get_all_requestIDs()

    assert len(requestIDs) == 2

    delivery2_without_requests = mabd.update_delivery(
        delivery2.get_id(), {"requests": []}
    )

    requestIDs = delivery2_without_requests.get_all_requestIDs()

    assert requestIDs == []
Exemple #2
0
def test_can_update_delivery_by_id():
    mabd = MABD()
    delivery_id = "recNoBUi8dqEwovSK"

    delivery = mabd.get_record_from_table_by_id("deliveries", delivery_id)

    assert delivery.get_fulfilment() == False
    assert mabd.get_delivery_by_number(3).get_fulfilment() == False

    update_dict = {"fulfilled?": True}

    updated_delivery = mabd.update_delivery(delivery_id, update_dict)

    assert updated_delivery.get_fulfilment() == True
    assert mabd.get_delivery_by_number(3).get_fulfilment() == True