Commit e05c5e7f authored by Kirill Smelkov's avatar Kirill Smelkov

commit: test: Ues at0 instead of head to represent initial transaction ID

`head` name is a bit ambiguous because it might be perceived as
referring to currently latest transaction ID, but in that test it
referes to latest transaction ID when the test starts.

Rename it to at0 for clarity.

Just added test_zodbcommit_cmd already uses at0  to represent initial
transaction ID (and at1 + at2 to represent follow-up transaction IDs).

In general using atX naming somes from WCFS functional tests where it is
used widely - see e.g.
https://lab.nexedi.com/nexedi/wendelin.core/-/blob/07087ec8/wcfs/wcfs_test.py#L1539-1581
parent ccb85991
...@@ -38,7 +38,7 @@ def test_zodbcommit(zsrv, zext): ...@@ -38,7 +38,7 @@ def test_zodbcommit(zsrv, zext):
stor = storageFromURL(zsrv.zurl) stor = storageFromURL(zsrv.zurl)
defer(stor.close) defer(stor.close)
head = stor.lastTransaction() at0 = stor.lastTransaction()
# commit some transactions via zodbcommit and verify if storage dump gives # commit some transactions via zodbcommit and verify if storage dump gives
# what is expected. # what is expected.
...@@ -46,7 +46,7 @@ def test_zodbcommit(zsrv, zext): ...@@ -46,7 +46,7 @@ def test_zodbcommit(zsrv, zext):
ObjectData(p64(1), b'data1', b('sha1'), sha1(b'data1')), ObjectData(p64(1), b'data1', b('sha1'), sha1(b'data1')),
ObjectData(p64(2), b'data2', b('sha1'), sha1(b'data2'))]) ObjectData(p64(2), b'data2', b('sha1'), sha1(b'data2'))])
t1.tid = zodbcommit(stor, head, t1) t1.tid = zodbcommit(stor, at0, t1)
t2 = Transaction(z64, ' ', b'user2', b'desc2', b'', [ t2 = Transaction(z64, ' ', b'user2', b'desc2', b'', [
ObjectDelete(p64(2))]) ObjectDelete(p64(2))])
...@@ -55,7 +55,7 @@ def test_zodbcommit(zsrv, zext): ...@@ -55,7 +55,7 @@ def test_zodbcommit(zsrv, zext):
buf = BytesIO() buf = BytesIO()
zodbdump(stor, p64(u64(head)+1), None, out=buf) zodbdump(stor, p64(u64(at0)+1), None, out=buf)
dumped = buf.getvalue() dumped = buf.getvalue()
assert dumped == b''.join([_.zdump() for _ in (t1, t2)]) assert dumped == b''.join([_.zdump() for _ in (t1, t2)])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment