Esempio n. 1
0
def test_store_empty_stack():
    state = State()
    with pytest.raises(exc.StackError):
        state.store()
Esempio n. 2
0
def test_store():
    state = State(stack=[5, 80])
    state.store()
    assert state.heap == {5: 80}
Esempio n. 3
0
def test_store_only_one_item_in_stack():
    state = State(stack=[5])
    with pytest.raises(exc.StackError):
        state.store()