[Zope-CVS] CVS: Products/DBTab/tests - testDBTab.py:1.2

Shane Hathaway shane@zope.com
Mon, 16 Jun 2003 13:56:17 -0400


Update of /cvs-repository/Products/DBTab/tests
In directory cvs.zope.org:/tmp/cvs-serv23607/tests

Modified Files:
	testDBTab.py 
Log Message:
Added a test of getMountPoint().


=== Products/DBTab/tests/testDBTab.py 1.1 => 1.2 ===
--- Products/DBTab/tests/testDBTab.py:1.1	Wed Jun 11 17:53:58 2003
+++ Products/DBTab/tests/testDBTab.py	Mon Jun 16 13:56:16 2003
@@ -20,8 +20,10 @@
 import Testing
 import ZODB
 from OFS.Application import Application
+from OFS.Folder import Folder
 from Products.DBTab.DBTab import DBTab
-from Products.DBTab.MountedObject import setConfiguration, manage_addMounts
+from Products.DBTab.MountedObject \
+     import setConfiguration, manage_addMounts, getMountPoint
 
 try:
     __file__
@@ -108,6 +110,20 @@
         finally:
             DB._closeConnection = DB._real_closeConnection
             del DB._real_closeConnection
+
+
+    def testGetMountPoint(self):
+        self.assert_(getMountPoint(self.app) is None)
+        self.assert_(getMountPoint(self.app.mount1) is not None)
+        self.assertEqual(getMountPoint(self.app.mount1)._path, '/mount1')
+        self.assert_(getMountPoint(self.app.mount2) is not None)
+        self.assertEqual(getMountPoint(self.app.mount2)._path, '/mount2')
+        del self.app.mount2
+        self.app.mount2 = Folder()
+        self.app.mount2.id = 'mount2'
+        self.assert_(getMountPoint(self.app.mount2) is None)
+        get_transaction().commit()
+        self.assert_(getMountPoint(self.app.mount2) is None)
 
 
 if __name__ == '__main__':