Commit 821efe8d authored by Grégory Wisniewski's avatar Grégory Wisniewski

Add an helper method to generate OIDs in test cases.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1479 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent c9619d9d
......@@ -131,6 +131,12 @@ class NeoTestBase(unittest.TestCase):
tid = pack('!LL', upper, lower)
return tid
def getOID(self, i=None):
""" Return a 8-bytes OID """
if i is None:
return os.urandom(4)
return pack('!Q', i)
def getTwoIDs(self):
""" Return a tuple of two sorted UUIDs """
# generate two ptid, first is lower
......
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