|
@@ -8,7 +8,7 @@ from ..hashindex import NSIndex
|
|
|
from ..helpers import Location, IntegrityError
|
|
|
from ..locking import Lock, LockFailed
|
|
|
from ..remote import RemoteRepository, InvalidRPCMethod
|
|
|
-from ..repository import Repository, LoggedIO, TAG_COMMIT
|
|
|
+from ..repository import Repository, LoggedIO, TAG_COMMIT, MAX_DATA_SIZE
|
|
|
from . import BaseTestCase
|
|
|
|
|
|
|
|
@@ -128,6 +128,13 @@ class RepositoryTestCase(RepositoryTestCaseBase):
|
|
|
self.assert_equal(second_half, all[50:])
|
|
|
self.assert_equal(len(self.repository.list(limit=50)), 50)
|
|
|
|
|
|
+ def test_max_data_size(self):
|
|
|
+ max_data = b'x' * MAX_DATA_SIZE
|
|
|
+ self.repository.put(b'00000000000000000000000000000000', max_data)
|
|
|
+ self.assert_equal(self.repository.get(b'00000000000000000000000000000000'), max_data)
|
|
|
+ self.assert_raises(IntegrityError,
|
|
|
+ lambda: self.repository.put(b'00000000000000000000000000000001', max_data + b'x'))
|
|
|
+
|
|
|
|
|
|
class RepositoryCommitTestCase(RepositoryTestCaseBase):
|
|
|
|