Пример #1
0
def test_push_locks_previously_unlocked_turnstile():
    turnstile = Turnstile(amount_for_passing=10)
    turnstile.change_state(Unlocked(turnstile))
    turnstile.push()
    assert turnstile.current_state() == "locked"
Пример #2
0
def test_insert_coins_keeps_unlocked_turnstile_unlocked():
    turnstile = Turnstile(amount_for_passing=10)
    turnstile.change_state(Unlocked(turnstile))
    turnstile.insert_coin(5)
    assert turnstile.current_state() == "unlocked"