Page MenuHomePhorge

Unit tests fail with "todo.created().isUTC() is false" error
Closed, ResolvedPublic

Description

Probably since https://git.kolab.org/rLKX2f28f2b1fb43b4f9b3ca0821508eee2afdaa443a pykolab unit tests fail with "todo.created().isUTC() is false" error, e.g.:

ERROR: test_001_minimal (tests.unit.test-003-event.TestEventXML)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/pykolab/tests/unit/test-003-event.py", line 367, in test_001_minimal
    self.assertIsInstance(self.event.__str__(), str)
  File "./pykolab/xml/event.py", line 1060, in __str__
    raise EventIntegrityError, kolabformat.errorMessage()
EventIntegrityError: /home/abuild/rpmbuild/BUILD/libkolabxml-1.2/src/objectvalidation.cpp 92:   event.created().isUTC() is false

BTW, there's one failing test more that should be fixed with:

 a/tests/unit/test-011-wallace_resources.py
+++ b/tests/unit/test-011-wallace_resources.py
@@ -117,7 +117,7 @@ class TestWallaceResources(unittest.TestCase):
 
     def _mock_find_resource(self, address):
         if not 'resource' in address:
-            return None
+            return [];
 
         (prefix, domain) = address.split('@')
         entry_dn = "cn=" + prefix + ",ou=Resources,dc=" + ",dc=".join(domain.split('.'))

Details

Ticket Type
Task

Event Timeline

D127 together with D123 are fixing unit tests. Now the output is:

[root@kolab pykolab]# nosetests ./tests/unit
...............................Error: /home/abuild/rpmbuild/BUILD/libkolabxml-1.2/src/objectvalidation.cpp 94:   event.start() is not set
Error: /home/abuild/rpmbuild/BUILD/libkolabxml-1.2/src/xcalconversions.h 1500:   Start date is missing, but is mandatory for events
Debug: /home/abuild/rpmbuild/BUILD/libkolabxml-1.2/src/kolabformat.cpp 94:   Error occurred while writing.
.......................unnamed app(16962) KCalCore::ICalFormatImpl::populate: No PRODID property found
unnamed app(16962) KSystemTimeZonesPrivate::readConfig: readConfig(): local zone= "UTC"
unnamed app(16962) KSystemTimeZonesPrivate::readZoneTab: readZoneTab( "/usr/share/zoneinfo/zone.tab" )
.....unnamed app(16962) KCalCore::ICalFormatImpl::populate: No PRODID property found
.....(20:39:09) timezoneconverter.cpp(51):      Guessed timezone and found:  "" 
(20:39:09) commonconversion.cpp(44):    invalid timezone:  "None" , assuming floating time 
.unnamed app(16962) KCalCore::ICalFormatImpl::populate: No PRODID property found
.Error: /home/abuild/rpmbuild/BUILD/libkolabxml-1.2/src/utils.h 114:   bad numeric conversion: negative overflow
Error: /home/abuild/rpmbuild/BUILD/libkolabxml-1.2/src/utils.h 114:   bad numeric conversion: negative overflow
schema exception
:25:25 error: value '' does not match regular expression facet '(\-|\+)?\d{4}\-\d{2}\-\d{2}T\d{2}:\d{2}:\d{2}(\.\d*)?Z?'
Critical: /home/abuild/rpmbuild/BUILD/libkolabxml-1.2/src/xcalconversions.h 1940:   Failed to parse calendar!
Debug: /home/abuild/rpmbuild/BUILD/libkolabxml-1.2/src/kolabformat.cpp 94:   Error occurred while writing.
........................................................................S.
----------------------------------------------------------------------
Ran 140 tests in 2.898s

OK (SKIP=1)