[Zodb-checkins] SVN: ZODB/branches/ctheune-blobsupport/src/Z Run ZEO server tests while backed with a BlobStorage-adapted FileStorage.

Chris McDonough chrism at plope.com
Fri Mar 25 13:03:03 EST 2005


Log message for revision 29684:
  Run ZEO server tests while backed with a BlobStorage-adapted FileStorage.
  
  Assert that blobs implement IBlob.
  

Changed:
  U   ZODB/branches/ctheune-blobsupport/src/ZEO/tests/testZEO.py
  U   ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/Blob.txt

-=-
Modified: ZODB/branches/ctheune-blobsupport/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/branches/ctheune-blobsupport/src/ZEO/tests/testZEO.py	2005-03-25 14:47:44 UTC (rev 29683)
+++ ZODB/branches/ctheune-blobsupport/src/ZEO/tests/testZEO.py	2005-03-25 18:03:02 UTC (rev 29684)
@@ -201,8 +201,33 @@
     def getConfig(self):
         return """<mappingstorage 1/>"""
 
-test_classes = [FileStorageTests, MappingStorageTests]
+class BlobAdaptedFileStorageTests(GenericTests):
+    """ZEO backed by a BlobStorage-adapted FileStorage."""
+    def setUp(self):
+        self.blobdir = tempfile.mkdtemp()
+        super(BlobAdaptedFileStorageTests, self).setUp()
+        
+    def tearDown(self):
+        import shutil
+        shutil.rmtree(self.blobdir)
+        super(BlobAdaptedFileStorageTests, self).tearDown()
 
+    def getConfig(self):
+        return """
+        <blobstorage 1>
+          blob-dir %s
+          <filestorage 2>
+            path %s
+          </filestorage>
+        </blobstorage>
+        """ % (self.blobdir, tempfile.mktemp())
+
+    def checkStoreBlob(self):
+        pass  
+
+test_classes = [FileStorageTests, MappingStorageTests,
+                BlobAdaptedFileStorageTests]
+
 def test_suite():
     suite = unittest.TestSuite()
     for klass in test_classes:

Modified: ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/Blob.txt
===================================================================
--- ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/Blob.txt	2005-03-25 14:47:44 UTC (rev 29683)
+++ ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/Blob.txt	2005-03-25 18:03:02 UTC (rev 29684)
@@ -20,6 +20,12 @@
     >>> from ZODB.Blobs.Blob import Blob
     >>> myblob = Blob()
 
+A blob implements the IBlob interface:
+
+    >>> from ZODB.Blobs.interfaces import IBlob
+    >>> IBlob.providedBy(myblob)
+    True
+
 Opening a new Blob for reading fails:
 
     >>> myblob.open("r")



More information about the Zodb-checkins mailing list