[CalendarServer-changes] [5987] CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore /test

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 5 13:24:58 PDT 2010


Revision: 5987
          http://trac.macosforge.org/projects/calendarserver/changeset/5987
Author:   glyph at apple.com
Date:     2010-08-05 13:24:58 -0700 (Thu, 05 Aug 2010)
Log Message:
-----------
Since the notifier factory is abstract and common to all back-end implementations, place the responsibility for creating it squarely onto the abstract and common test infrastructure.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/common.py
    CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_file.py
    CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py

Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/common.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/common.py	2010-08-05 20:17:12 UTC (rev 5986)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/common.py	2010-08-05 20:24:58 UTC (rev 5987)
@@ -211,6 +211,10 @@
         self.lastTransaction = None
 
 
+    def setUp(self):
+        self.notifierFactory = StubNotifierFactory()
+
+
     def tearDown(self):
         if self.lastTransaction is not None:
             self.commit()

Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_file.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_file.py	2010-08-05 20:17:12 UTC (rev 5986)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_file.py	2010-08-05 20:24:58 UTC (rev 5987)
@@ -18,6 +18,10 @@
 File calendar store tests.
 """
 
+# FIXME: all test cases in this file aside from FileStorageTests should be
+# deleted and replaced with either implementation-specific methods on
+# FileStorageTests, or implementation-agnostic methods on CommonTests.
+
 from twext.python.filepath import CachingFilePath as FilePath
 from twisted.trial import unittest
 
@@ -33,7 +37,7 @@
 from txcaldav.calendarstore.file import Calendar, CalendarObject
 
 from txcaldav.calendarstore.test.common import (
-    CommonTests, event4_text, event1modified_text, StubNotifierFactory)
+    CommonTests, event4_text, event1modified_text)
 
 storePath = FilePath(__file__).parent().child("calendar_store")
 
@@ -58,7 +62,6 @@
     calendarPath.parent().makedirs()
     storePath.copyTo(calendarPath)
 
-    test.notifierFactory = StubNotifierFactory()
     test.calendarStore = CalendarStore(storeRootPath, test.notifierFactory)
     test.txn = test.calendarStore.newTransaction()
     assert test.calendarStore is not None, "No calendar store?"
@@ -84,6 +87,8 @@
     Test cases for L{CalendarStore}.
     """
 
+    notifierFactory = None
+
     def setUp(self):
         setUpCalendarStore(self)
 
@@ -102,6 +107,7 @@
 
 class CalendarHomeTest(unittest.TestCase):
 
+    notifierFactory = None
     def setUp(self):
         setUpHome1(self)
 
@@ -158,6 +164,8 @@
 
 class CalendarTest(unittest.TestCase):
 
+    notifierFactory = None
+
     def setUp(self):
         setUpCalendar1(self)
 
@@ -400,6 +408,8 @@
 
 
 class CalendarObjectTest(unittest.TestCase):
+    notifierFactory = None
+
     def setUp(self):
         setUpCalendar1(self)
         self.object1 = self.calendar1.calendarObjectWithName("1.ics")

Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py	2010-08-05 20:17:12 UTC (rev 5986)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py	2010-08-05 20:24:58 UTC (rev 5987)
@@ -60,6 +60,7 @@
     """
 
     def setUp(self):
+        super(SQLStorageTests, self).setUp()
         global sharedService
         global currentTestID
         currentTestID = self.id()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100805/bd6b41fc/attachment.html>


More information about the calendarserver-changes mailing list