Пример #1
0
def test_store_empty_stack():
    state = State()
    with pytest.raises(exc.StackError):
        state.store()
Пример #2
0
def test_store():
    state = State(stack=[5, 80])
    state.store()
    assert state.heap == {5: 80}
Пример #3
0
def test_store_only_one_item_in_stack():
    state = State(stack=[5])
    with pytest.raises(exc.StackError):
        state.store()