pykolab/xml tests/unit

Thomas Brüderli bruederli at kolabsys.com
Tue Feb 17 20:14:54 CET 2015


 pykolab/xml/utils.py         |    2 +-
 tests/unit/test-003-event.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit f69ed719f3c38190f63618191a8d2f4b61522393
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Mon Feb 16 23:29:38 2015 +0100

    Fix property_to_string() utiliy function and its tests

diff --git a/pykolab/xml/utils.py b/pykolab/xml/utils.py
index a3ecbcf..9ff29b6 100644
--- a/pykolab/xml/utils.py
+++ b/pykolab/xml/utils.py
@@ -183,7 +183,7 @@ def property_to_string(propname, value):
 
         elif propname == 'rrule':
             from . import recurrence_rule
-            rrule = recurrence_rule.frequency_label(value['frequency']) % (value['interval'])
+            rrule = recurrence_rule.frequency_label(value['freq']) % (value['interval'])
             if value.has_key('count') and value['count'] > 0:
                 rrule += " " + _("for %d times") % (value['count'])
             elif value.has_key('until') and (isinstance(value['until'], datetime.datetime) or isinstance(value['until'], datetime.date)):
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index 10e6abd..02520e7 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -806,10 +806,10 @@ END:VEVENT
     def test_026_property_to_string(self):
         data = event_from_string(xml_event).to_dict()
         self.assertEqual(property_to_string('sequence', data['sequence']), "1")
-        self.assertEqual(property_to_string('start', data['start']), "2014-08-13 10:00 (GMT)")
+        self.assertEqual(property_to_string('start', data['start']), "2014-08-13 10:00 (BST)")
         self.assertEqual(property_to_string('organizer', data['organizer']), "Doe, John")
         self.assertEqual(property_to_string('attendee', data['attendee'][0]), "jane at example.org, Accepted")
-        self.assertEqual(property_to_string('rrule', data['rrule']), "Every 1 day(s) until 2014-07-25")
+        self.assertEqual(property_to_string('rrule', data['rrule']), "Every 1 day(s) until 2015-07-25")
         self.assertEqual(property_to_string('exdate', data['exdate'][0]), "2014-07-19")
         self.assertEqual(property_to_string('alarm', data['alarm'][0]), "Display message 2 hour(s) before")
         self.assertEqual(property_to_string('attach', data['attach'][0]), "noname.1395223627.5555")




More information about the commits mailing list