def test_can_accept_closed() -> None:
    """ Test whether line can accept when it is closed."""
    line = RegularLine(1)
    line.is_open = False
    item_list = [Item('bananas', 1), Item('bananas', 1)]
    jeff = Customer('Jeff', item_list)
    assert not line.can_accept(jeff)
Example #2
0
def test_checkout_cannot_accept_when_line_is_closed() -> None:
    """check if a customer can enter a line if line is closed"""
    customer1 = Customer("bruce", [])
    line1 = RegularLine(3)
    line1.is_open = False
    assert line1.can_accept(customer1) is False
    line2 = SelfServeLine(3)
    line2.is_open = False
    assert line2.can_accept(customer1) is False
    line3 = ExpressLine(3)
    line3.is_open = False
    assert line3.can_accept(customer1) is False