示例#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()