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