Add getBytes to conflict_set.py

This commit is contained in:
2024-04-08 17:33:51 -07:00
parent 325cab6a95
commit 738de01cb4
2 changed files with 12 additions and 3 deletions
+6 -3
View File
@@ -3,7 +3,10 @@ from conflict_set import *
def test_conflict_set():
with ConflictSet() as cs:
cs.addWrites(1, write(b""))
assert cs.check(read(0, b"")) == [Result.CONFLICT]
before = cs.getBytes()
key = b"a key"
cs.addWrites(1, write(key))
assert cs.getBytes() - before > 0
assert cs.check(read(0, key)) == [Result.CONFLICT]
cs.setOldestVersion(1)
assert cs.check(read(0, b"")) == [Result.TOO_OLD]
assert cs.check(read(0, key)) == [Result.TOO_OLD]