[Zodb-checkins] CVS: ZODB3/ZEO/tests - testConnection.py:1.8 testZEO.py:1.60

Barry Warsaw barry@wooz.org
Fri, 3 Jan 2003 17:52:43 -0500


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv30251/ZEO/tests

Modified Files:
	testConnection.py testZEO.py 
Log Message:
Here's a principled way to determine whether the BDBStorages are
available or not, and also fixes to all the tests so they won't crap
out or complain if not.

To test whether these storages are avialable (including all package
dependencies), do:

import BDBStorage
if BDBStorage.is_available:
    # okay to use

Also, in BDBStorage/__init__.py do some cross-platform compatibility
for the bsddb module; in Python 2.3 we can just use the built-in
module, but in earlier Pythons we have to use bsddb3.  Now you can
just use "from BDBStorage import db" to get the proper db object.


=== ZODB3/ZEO/tests/testConnection.py 1.7 => 1.8 ===
--- ZODB3/ZEO/tests/testConnection.py:1.7	Wed Dec 18 17:15:04 2002
+++ ZODB3/ZEO/tests/testConnection.py	Fri Jan  3 17:52:09 2003
@@ -75,11 +75,9 @@
 
 
 test_classes = [FileStorageConnectionTests, FileStorageReconnectionTests]
-try:
-    from BDBStorage.BDBFullStorage import BDBFullStorage
-except ImportError:
-    pass
-else:
+
+import BDBStorage
+if BDBStorage.is_available:
     test_classes.append(BDBConnectionTests)
     test_classes.append(BDBReconnectionTests)
 


=== ZODB3/ZEO/tests/testZEO.py 1.59 => 1.60 ===
--- ZODB3/ZEO/tests/testZEO.py:1.59	Wed Dec 18 17:15:04 2002
+++ ZODB3/ZEO/tests/testZEO.py	Fri Jan  3 17:52:09 2003
@@ -175,11 +175,9 @@
 
 
 test_classes = [FileStorageTests]
-try:
-    from BDBStorage.BDBFullStorage import BDBFullStorage
-except ImportError:
-    pass
-else:
+
+import BDBStorage
+if BDBStorage.is_available:
     test_classes.append(BDBTests)