forked from weaselab/conflict-set
Add getBytes to conflict_set.py
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user