[CalendarServer-changes] [973] CalendarServer/trunk/twistedcaldav/directory/test/test_sqldb.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 8 13:09:00 PST 2007


Revision: 973
          http://trac.macosforge.org/projects/calendarserver/changeset/973
Author:   wsanchez at apple.com
Date:     2007-01-08 13:09:00 -0800 (Mon, 08 Jan 2007)

Log Message:
-----------
Clean up test_verifyRealmFromDB.
 - Don't assume that the DB already exists initialized from XML; order of tests isn't guaranteed.
 - Not sure why were were defining a function that is only ever called once.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/test/test_sqldb.py

Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_sqldb.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/test/test_sqldb.py	2007-01-08 20:32:01 UTC (rev 972)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_sqldb.py	2007-01-08 21:09:00 UTC (rev 973)
@@ -44,8 +44,10 @@
     test_verifyCredentials_digest.todo = ""
 
     def test_verifyRealmFromDB(self):
+        # Make sure the database has been initialized with the XML file
+        self.service()
 
-        def _service():
-            return SQLDirectoryService(os.getcwd(), None)
+        # Then get an instance without using the XML file
+        service = SQLDirectoryService(os.getcwd(), None)
 
-        self.assertEquals(_service().realmName, "Test")
+        self.assertEquals(service.realmName, "Test")

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070108/999cd1cf/attachment.html


More information about the calendarserver-changes mailing list