[CalendarServer-changes] [5534] CalendarServer/branches/users/wsanchez/transations

source_changes at macosforge.org source_changes at macosforge.org
Tue Apr 27 12:03:16 PDT 2010


Revision: 5534
          http://trac.macosforge.org/projects/calendarserver/changeset/5534
Author:   wsanchez at apple.com
Date:     2010-04-27 12:03:13 -0700 (Tue, 27 Apr 2010)
Log Message:
-----------
Fix comparison by adding .timetuple, per http://bugs.python.org/issue8005

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/transations/conf/auth/accounts-test.xml
    CalendarServer/branches/users/wsanchez/transations/conf/auth/augments-test.xml
    CalendarServer/branches/users/wsanchez/transations/test
    CalendarServer/branches/users/wsanchez/transations/twext/python/datetime.py
    CalendarServer/branches/users/wsanchez/transations/twext/python/test/test_datetime.py

Modified: CalendarServer/branches/users/wsanchez/transations/conf/auth/accounts-test.xml
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/conf/auth/accounts-test.xml	2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/conf/auth/accounts-test.xml	2010-04-27 19:03:13 UTC (rev 5534)
@@ -35,6 +35,51 @@
     <first-name>Apprentice</first-name>
     <last-name>Super User</last-name>
   </user>
+  <user>
+    <uid>wsanchez</uid>
+    <guid>wsanchez</guid>
+    <email-address>wsanchez at apple.com</email-address>
+    <password>demo</password>
+    <name>Wilfredo Sanchez Vega</name>
+    <first-name>Wilfredo</first-name>
+    <last-name>Sanchez Vega</last-name>
+  </user>
+  <user>
+    <uid>cdaboo</uid>
+    <guid>cdaboo</guid>
+    <email-address>cdaboo at apple.com</email-address>
+    <password>demo</password>
+    <name>Cyrus Daboo</name>
+    <first-name>Cyrus</first-name>
+    <last-name>Daboo</last-name>
+  </user>
+  <user>
+    <uid>sagen</uid>
+    <guid>sagen</guid>
+    <email-address>sagen at apple.com</email-address>
+    <password>demo</password>
+    <name>Morgen Sagen</name>
+    <first-name>Morgen</first-name>
+    <last-name>Sagen</last-name>
+  </user>
+  <user>
+    <uid>dre</uid>
+    <guid>andre</guid>
+    <email-address>dre at apple.com</email-address>
+    <password>demo</password>
+    <name>Andre LaBranche</name>
+    <first-name>Andre</first-name>
+    <last-name>LaBranche</last-name>
+  </user>
+  <user>
+    <uid>glyph</uid>
+    <guid>glyph</guid>
+    <email-address>glyph at apple.com</email-address>
+    <password>demo</password>
+    <name>Glyph Lefkowitz</name>
+    <first-name>Glyph</first-name>
+    <last-name>Lefkowitz</last-name>
+  </user>
   <user repeat="99">
     <uid>user%02d</uid>
     <uid>User %02d</uid>
@@ -102,4 +147,58 @@
       <member type="users">user01</member>
     </members>
   </group>
+  <location>
+    <uid>mercury</uid>
+    <guid>mercury</guid>
+    <password>demo</password>
+    <name>Mecury Conference Room, Building 1, 2nd Floor</name>
+  </location>
+  <location>
+    <uid>venus</uid>
+    <guid>venus</guid>
+    <password>demo</password>
+    <name>Venus Conference Room, Building 1, 2nd Floor</name>
+  </location>
+  <location>
+    <uid>Earth</uid>
+    <guid>Earth</guid>
+    <password>demo</password>
+    <name>Earth Conference Room, Building 1, 1st Floor</name>
+  </location>
+  <location>
+    <uid>mars</uid>
+    <guid>mars</guid>
+    <password>demo</password>
+    <name>Mars Conference Room, Building 1, 1st Floor</name>
+  </location>
+  <location>
+    <uid>jupiter</uid>
+    <guid>jupiter</guid>
+    <password>demo</password>
+    <name>Jupiter Conference Room, Building 2, 1st Floor</name>
+  </location>
+  <location>
+    <uid>neptune</uid>
+    <guid>neptune</guid>
+    <password>demo</password>
+    <name>Neptune Conference Room, Building 2, 1st Floor</name>
+  </location>
+  <location>
+    <uid>pluto</uid>
+    <guid>pluto</guid>
+    <password>demo</password>
+    <name>Pluto Conference Room, Building 2, 1st Floor</name>
+  </location>
+  <location>
+    <uid>saturn</uid>
+    <guid>saturn</guid>
+    <password>demo</password>
+    <name>Saturn Conference Room, Building 2, 1st Floor</name>
+  </location>
+  <location>
+    <uid>uranus</uid>
+    <guid>uranus</guid>
+    <password>demo</password>
+    <name>Uranus Conference Room, Building 3, 1st Floor</name>
+  </location>
 </accounts>

Modified: CalendarServer/branches/users/wsanchez/transations/conf/auth/augments-test.xml
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/conf/auth/augments-test.xml	2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/conf/auth/augments-test.xml	2010-04-27 19:03:13 UTC (rev 5534)
@@ -25,6 +25,38 @@
     <enable-calendar>true</enable-calendar>
     <enable-addressbook>true</enable-addressbook>
   </record>
+
+  <record>
+    <uid>wsanchez</uid>
+    <enable>true</enable>
+    <enable-calendar>true</enable-calendar>
+    <enable-addressbook>true</enable-addressbook>
+  </record>
+  <record>
+    <uid>glyph</uid>
+    <enable>true</enable>
+    <enable-calendar>true</enable-calendar>
+    <enable-addressbook>true</enable-addressbook>
+  </record>
+  <record>
+    <uid>sagen</uid>
+    <enable>true</enable>
+    <enable-calendar>true</enable-calendar>
+    <enable-addressbook>true</enable-addressbook>
+  </record>
+  <record>
+    <uid>dre</uid>
+    <enable>true</enable>
+    <enable-calendar>true</enable-calendar>
+    <enable-addressbook>true</enable-addressbook>
+  </record>
+  <record>
+    <uid>cdaboo</uid>
+    <enable>true</enable>
+    <enable-calendar>true</enable-calendar>
+    <enable-addressbook>true</enable-addressbook>
+  </record>
+
   <record repeat="10">
     <uid>location%02d</uid>
     <enable>true</enable>

Modified: CalendarServer/branches/users/wsanchez/transations/test
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/test	2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/test	2010-04-27 19:03:13 UTC (rev 5534)
@@ -72,4 +72,4 @@
     test_modules="calendarserver twistedcaldav twext txdav txcaldav txcarddav ${m_twisted}";
 fi;
 
-cd "${wd}" && "${python}" "${twisted}/bin/trial" --rterrors ${random} ${until_fail} ${no_colour} ${coverage} ${test_modules};
+cd "${wd}" && "trial" --rterrors ${random} ${until_fail} ${no_colour} ${coverage} ${test_modules};

Modified: CalendarServer/branches/users/wsanchez/transations/twext/python/datetime.py
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/twext/python/datetime.py	2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/twext/python/datetime.py	2010-04-27 19:03:13 UTC (rev 5534)
@@ -136,6 +136,14 @@
     def dateOrDatetime(self):
         return self._dateOrDatetime
 
+    def timetuple(self):
+        #
+        # This is required to make comparison with datetimes work. See:
+        # http://bugs.python.org/issue8005
+        # http://docs.python.org/release/2.6.5/library/datetime.html#datetime.date.day
+        #
+        return self._dateOrDatetime.timetuple()
+
     def iCalendarString(self):
         if self._isDatetime:
             return dateTimeToString(self._dateOrDatetime)

Modified: CalendarServer/branches/users/wsanchez/transations/twext/python/test/test_datetime.py
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/twext/python/test/test_datetime.py	2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/twext/python/test/test_datetime.py	2010-04-27 19:03:13 UTC (rev 5534)
@@ -46,6 +46,10 @@
 
 
 class DatetimeTests(TestCase):
+    @testUnimplemented
+    def test_timetuple(self):
+        raise NotImplementedError()
+
     @timezones
     def test_date_date(self, tz):
         d = date.today()
@@ -101,7 +105,7 @@
         #
 
         self.assertTrue (first        == base(first) )
-       #self.assertTrue (base(first)  == first       ) # Bug in datetime
+        self.assertTrue (base(first)  == first       ) # Bug in datetime
         self.assertTrue (first        == base(first) )
         self.assertTrue (first        != base(second))
         self.assertTrue (base(first)  != second      )
@@ -109,36 +113,36 @@
         self.assertTrue (first        <  second      )
         self.assertTrue (second       <  third       )
         self.assertTrue (first        <  base(second))
-       #self.assertTrue (base(second) <  third       ) # Bug in datetime
+        self.assertTrue (base(second) <  third       ) # Bug in datetime
         self.assertTrue (first        <  second      )
         self.assertTrue (second       <  third       )
-       #self.assertTrue (base(first)  <  second      )
+        self.assertTrue (base(first)  <  second      )
         self.assertTrue (second       <  base(third) ) # Bug in datetime
         self.assertTrue (first        <= second      )
         self.assertTrue (second       <= third       )
         self.assertTrue (first        <= base(second))
-       #self.assertTrue (base(second) <= third       ) # Bug in datetime
+        self.assertTrue (base(second) <= third       ) # Bug in datetime
         self.assertTrue (first        <= base(second))
-       #self.assertTrue (base(second) <= third       ) # Bug in datetime
+        self.assertTrue (base(second) <= third       ) # Bug in datetime
         self.assertTrue (first        <= second      )
         self.assertTrue (second       <= third       )
-       #self.assertTrue (base(first)  <= second      ) # Bug in datetime
+        self.assertTrue (base(first)  <= second      ) # Bug in datetime
         self.assertTrue (second       <= base(third) )
         self.assertFalse(first        >  second      )
         self.assertFalse(second       >  third       )
         self.assertFalse(first        >  base(second))
-       #self.assertFalse(base(second) >  third       ) # Bug in datetime
+        self.assertFalse(base(second) >  third       ) # Bug in datetime
         self.assertFalse(first        >  second      )
         self.assertFalse(second       >  third       )
-       #self.assertFalse(base(first)  >  second      ) # Bug in datetime
+        self.assertFalse(base(first)  >  second      ) # Bug in datetime
         self.assertFalse(second       >  base(third) )
         self.assertFalse(first        >= second      )
         self.assertFalse(second       >= third       )
         self.assertFalse(first        >= base(second))
-       #self.assertFalse(base(second) >= third       ) # Bug in datetime
+        self.assertFalse(base(second) >= third       ) # Bug in datetime
         self.assertFalse(first        >= second      )
         self.assertFalse(second       >= third       )
-       #self.assertFalse(base(first)  >= second      ) # Bug in datetime
+        self.assertFalse(base(first)  >= second      ) # Bug in datetime
         self.assertFalse(second       >= base(third) )
 
     def test_date_iCalendarString(self):
@@ -231,7 +235,7 @@
 
     @testUnimplemented
     def test_compare(self):
-        raise NotImplemented
+        raise NotImplementedError()
 
     @featureUnimplemented
     def test_overlapsWith(self):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100427/1ba19e60/attachment-0001.html>


More information about the calendarserver-changes mailing list