[CalendarServer-changes] [6029] CalendarServer/branches/users/glyph/sql-store

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 10 08:32:45 PDT 2010


Revision: 6029
          http://trac.macosforge.org/projects/calendarserver/changeset/6029
Author:   sagen at apple.com
Date:     2010-08-10 08:32:43 -0700 (Tue, 10 Aug 2010)
Log Message:
-----------
Use assertEquals for better error messages

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/common.py
    CalendarServer/branches/users/glyph/sql-store/txcarddav/addressbookstore/test/common.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-10 15:22:06 UTC (rev 6028)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/common.py	2010-08-10 15:32:43 UTC (rev 6029)
@@ -391,7 +391,7 @@
         self.commit()
 
         # Make sure notification fired after commit
-        self.assertTrue(self.notifierFactory.compare([("update", "home1")]))
+        self.assertEquals(self.notifierFactory.history, [("update", "home1")])
 
         # Make sure it's available in a new transaction; i.e. test the commit.
         home = self.homeUnderTest()
@@ -434,10 +434,9 @@
         self.commit()
 
         # Make sure notification fired after commit
-        self.assertTrue(
-            self.notifierFactory.compare(
-                [("update", "home1"), ("update", "home1"), ("update", "home1")]
-            )
+        self.assertEquals(
+            self.notifierFactory.history,
+            [("update", "home1"), ("update", "home1"), ("update", "home1")]
         )
 
 
@@ -537,17 +536,16 @@
 
         # Make sure notifications are fired after commit
         self.commit()
-        self.assertTrue(
-            self.notifierFactory.compare(
-                [
-                    ("update", "home1"),
-                    ("update", "home1/calendar_1"),
-                    ("update", "home1"),
-                    ("update", "home1/calendar_1"),
-                    ("update", "home1"),
-                    ("update", "home1/calendar_1"),
-                ]
-            )
+        self.assertEquals(
+            self.notifierFactory.history,
+            [
+                ("update", "home1"),
+                ("update", "home1/calendar_1"),
+                ("update", "home1"),
+                ("update", "home1/calendar_1"),
+                ("update", "home1"),
+                ("update", "home1/calendar_1"),
+            ]
         )
 
     def test_removeCalendarObjectWithName_exists(self):
@@ -699,13 +697,12 @@
         self.commit()
 
         # Make sure notifications fire after commit
-        self.assertTrue(
-            self.notifierFactory.compare(
-                [
-                    ("update", "home1"),
-                    ("update", "home1/calendar_1"),
-                ]
-            )
+        self.assertEquals(
+            self.notifierFactory.history,
+            [
+                ("update", "home1"),
+                ("update", "home1/calendar_1"),
+            ]
         )
 
 
@@ -811,13 +808,12 @@
         self.commit()
 
         # Make sure notification fired after commit
-        self.assertTrue(
-            self.notifierFactory.compare(
-                [
-                    ("update", "home1"),
-                    ("update", "home1/calendar_1"),
-                ]
-            )
+        self.assertEquals(
+            self.notifierFactory.history,
+            [
+                ("update", "home1"),
+                ("update", "home1/calendar_1"),
+            ]
         )
 
 
@@ -1103,11 +1099,7 @@
         return Notifier(self, label=label, id=id)
 
     def send(self, op, id):
-        self._history.append((op, id))
+        self.history.append((op, id))
 
     def reset(self):
-        self._history = []
-
-    def compare(self, expected):
-        return self._history == expected
-
+        self.history = []

Modified: CalendarServer/branches/users/glyph/sql-store/txcarddav/addressbookstore/test/common.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcarddav/addressbookstore/test/common.py	2010-08-10 15:22:06 UTC (rev 6028)
+++ CalendarServer/branches/users/glyph/sql-store/txcarddav/addressbookstore/test/common.py	2010-08-10 15:32:43 UTC (rev 6029)
@@ -350,7 +350,7 @@
         self.commit()
 
         # Make sure notification fired after commit
-        self.assertTrue(self.notifierFactory.compare([("update", "home1")]))
+        self.assertEquals(self.notifierFactory.history, [("update", "home1")])
 
         # Make sure it's available in a new transaction; i.e. test the commit.
         home = self.homeUnderTest()
@@ -393,8 +393,10 @@
         self.commit()
 
         # Make sure notification fired after commit
-        self.assertTrue(self.notifierFactory.compare(
-            [("update", "home1"), ("update", "home1"), ("update", "home1")]))
+        self.assertEquals(
+            self.notifierFactory.history,
+            [("update", "home1"), ("update", "home1"), ("update", "home1")]
+        )
 
 
     def test_removeAddressBookWithName_absent(self):
@@ -508,17 +510,16 @@
 
         # Make sure notifications are fired after commit
         self.commit()
-        self.assertTrue(
-            self.notifierFactory.compare(
-                [
-                    ("update", "home1"),
-                    ("update", "home1/addressbook_1"),
-                    ("update", "home1"),
-                    ("update", "home1/addressbook_1"),
-                    ("update", "home1"),
-                    ("update", "home1/addressbook_1"),
-                ]
-            )
+        self.assertEquals(
+            self.notifierFactory.history,
+            [
+                ("update", "home1"),
+                ("update", "home1/addressbook_1"),
+                ("update", "home1"),
+                ("update", "home1/addressbook_1"),
+                ("update", "home1"),
+                ("update", "home1/addressbook_1"),
+            ]
         )
 
 
@@ -643,13 +644,12 @@
         self.commit()
 
         # Make sure notifications fire after commit
-        self.assertTrue(
-            self.notifierFactory.compare(
-                [
-                    ("update", "home1"),
-                    ("update", "home1/addressbook_1"),
-                ]
-            )
+        self.assertEquals(
+            self.notifierFactory.history,
+            [
+                ("update", "home1"),
+                ("update", "home1/addressbook_1"),
+            ]
         )
 
 
@@ -750,13 +750,12 @@
         self.commit()
 
         # Make sure notification fired after commit
-        self.assertTrue(
-            self.notifierFactory.compare(
-                [
-                    ("update", "home1"),
-                    ("update", "home1/addressbook_1"),
-                ]
-            )
+        self.assertEquals(
+            self.notifierFactory.history,
+            [
+                ("update", "home1"),
+                ("update", "home1/addressbook_1"),
+            ]
         )
 
     def checkPropertiesMethod(self, thunk):
@@ -856,10 +855,7 @@
         return Notifier(self, label=label, id=id)
 
     def send(self, op, id):
-        self._history.append((op, id))
+        self.history.append((op, id))
 
     def reset(self):
-        self._history = []
-
-    def compare(self, expected):
-        return self._history == expected
+        self.history = []
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100810/06a7380f/attachment.html>


More information about the calendarserver-changes mailing list