Commit e2294d5e authored by Grégory Wisniewski's avatar Grégory Wisniewski

Define MAX_TID to a different value than INVALID_TID.

And remove its definition from protocol as it's used only by tests.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2589 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 34a00f85
...@@ -113,7 +113,6 @@ ZERO_TID = '\0' * 8 ...@@ -113,7 +113,6 @@ ZERO_TID = '\0' * 8
ZERO_OID = '\0' * 8 ZERO_OID = '\0' * 8
OID_LEN = len(INVALID_OID) OID_LEN = len(INVALID_OID)
TID_LEN = len(INVALID_TID) TID_LEN = len(INVALID_TID)
MAX_TID = '\xff' * 8
UUID_NAMESPACES = { UUID_NAMESPACES = {
NodeTypes.STORAGE: 'S', NodeTypes.STORAGE: 'S',
......
...@@ -30,6 +30,7 @@ from neo.protocol import ZERO_OID, ZERO_TID ...@@ -30,6 +30,7 @@ from neo.protocol import ZERO_OID, ZERO_TID
MAX_TRANSACTIONS = 10000 MAX_TRANSACTIONS = 10000
MAX_OBJECTS = 100000 MAX_OBJECTS = 100000
MAX_TID = '\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE' # != INVALID_TID
class FakeConnection(object): class FakeConnection(object):
...@@ -77,7 +78,7 @@ class ReplicationTests(NeoUnitTestBase): ...@@ -77,7 +78,7 @@ class ReplicationTests(NeoUnitTestBase):
oapp.replicator = Replicator(oapp) oapp.replicator = Replicator(oapp)
oapp.replicator.getCurrentRID = lambda: 0 oapp.replicator.getCurrentRID = lambda: 0
oapp.replicator.isCurrentConnection = lambda c: True oapp.replicator.isCurrentConnection = lambda c: True
oapp.replicator.getCurrentCriticalTID = lambda: '\xFF' * 8 oapp.replicator.getCurrentCriticalTID = lambda: MAX_TID
# handlers and connections # handlers and connections
rhandler = StorageOperationHandler(rapp) rhandler = StorageOperationHandler(rapp)
rconn = FakeConnection() rconn = FakeConnection()
......
...@@ -18,11 +18,13 @@ ...@@ -18,11 +18,13 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.util import dump, p64, u64 from neo.util import dump, p64, u64
from neo.protocol import CellStates, ZERO_OID, ZERO_TID, MAX_TID from neo.protocol import CellStates, ZERO_OID, ZERO_TID
from neo.tests import NeoUnitTestBase from neo.tests import NeoUnitTestBase
from neo.exception import DatabaseFailure from neo.exception import DatabaseFailure
from neo.storage.database.mysqldb import MySQLDatabaseManager from neo.storage.database.mysqldb import MySQLDatabaseManager
MAX_TID = '\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE' # != INVALID_TID
class StorageDBTests(NeoUnitTestBase): class StorageDBTests(NeoUnitTestBase):
def setUp(self): def setUp(self):
......
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