Ejemplo n.º 1
0
def test_absolute_fullness() -> None:
    t = Truck(69, 420, "Toronto")
    p = Parcel(1, 60, "Cape Town", "Barrie")
    t.pack(p)
    assert t.capacity - t.absolute_fullness() == 360
Ejemplo n.º 2
0
def _less_truck_space(t1: Truck, t2: Truck) -> bool:
    """
    Returns True if Truck <t1> has less truck space. False otherwise.
    """
    return (t1.capacity - t1.absolute_fullness()) < \
           (t2.capacity - t2.absolute_fullness())