[Zodb-checkins] CVS: StandaloneZODB/ZODB/tests - testFileStorage.py:1.17

Jeremy Hylton jeremy@zope.com
Mon, 22 Apr 2002 18:23:50 -0400


Update of /cvs-repository/StandaloneZODB/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv25759/ZODB/tests

Modified Files:
	testFileStorage.py 
Log Message:
Simplify tpc_vote() and reflow some long lines.

Add test case for long metadata.


=== StandaloneZODB/ZODB/tests/testFileStorage.py 1.16 => 1.17 ===
 import errno
 from ZODB.Transaction import Transaction
+from ZODB import POSException
 
 from ZODB.tests import StorageTestBase, BasicStorage, \
      TransactionalUndoStorage, VersionStorage, \
@@ -47,6 +48,21 @@
             path = 'FileStorageTests.fs' + ext
             if os.path.exists(path):
                 os.remove(path)
+
+    def checkLongMetadata(self):
+        s = "X" * 75000
+        try:
+            self._dostore(user=s)
+        except POSException.StorageError:
+            pass
+        else:
+            self.fail("expect long user field to raise error")
+        try:
+            self._dostore(description=s)
+        except POSException.StorageError:
+            pass
+        else:
+            self.fail("expect long user field to raise error")
 
 class FileStorageRecoveryTest(
     StorageTestBase.StorageTestBase,