Add check removed, flake8 check
@@ -9,6 +9,7 @@ from storage.kv_in_memory import KeyValueStorageInMemory
rand = 1000
+
@pytest.fixture()
def state():
return PruningState(KeyValueStorageInMemory())
@@ -48,13 +49,17 @@ def sequence(data):
@pytest.mark.parametrize('execution_number', range(10))
def test_removal_from_trie(sequence, state, execution_number):
sequence, data = sequence
+ removedKeys = []
for action, key, val in sequence:
if action == 1:
assert val == int(state.get(key.encode(), isCommitted=False).decode())
state.remove(key.encode())
+ removedKeys.append(key)
elif action == 0:
state.set(key.encode(), str(val).encode())
elif action == 2:
state.commit()
for key, val in data:
assert val == int(state.get(key.encode(), isCommitted=False).decode())
+ for key in removedKeys:
+ assert state.get(key.encode(), isCommitted=False) is None
