5 commits - configure.ac pykolab/setup tests/unit

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Fri Jul 20 11:34:14 CEST 2012


 configure.ac                    |    2 +-
 pykolab/setup/setup_mta.py      |    3 +++
 tests/unit/test-005-timezone.py |   31 +++++++++++++++++++++++++++----
 3 files changed, 31 insertions(+), 5 deletions(-)

New commits:
commit efaef7e429879c34d30c12c4561ab201f2dec27e
Merge: c3cb7ec bde1f6b
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Fri Jul 20 10:34:05 2012 +0100

    Merge branch 'master' of ssh://git.kolabsys.com/git/pykolab

diff --cc tests/unit/test-005-timezone.py
index 0000000,9b12c66..8110e30
mode 000000,100644..100644
--- a/tests/unit/test-005-timezone.py
+++ b/tests/unit/test-005-timezone.py
@@@ -1,0 -1,50 +1,73 @@@
+ import datetime
+ import icalendar
++import os
+ import pytz
+ import unittest
+ 
+ from pykolab.xml import Attendee
+ from pykolab.xml import Event
+ from pykolab.xml import EventIntegrityError
+ from pykolab.xml import InvalidAttendeeParticipantStatusError
+ from pykolab.xml import InvalidEventDateError
+ from pykolab.xml import event_from_ical
+ 
+ class TestTimezone(unittest.TestCase):
+ 
+     def test_001_timezone_conflict(self):
++        #class datetime.timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]])
++        tdelta = datetime.timedelta(0, 0, 0, 0, 0, 1)
++
++        event_start = datetime.datetime.now(pytz.timezone("UTC"))
++        event_end = datetime.datetime.now(pytz.timezone("UTC")) + tdelta
++
+         london = Event()
+         london.set_organizer("john.doe at example.org", "Doe, John")
+         london.add_attendee("resource-car-vw at example.org", cutype="RESOURCE")
 -        london.set_start(datetime.datetime.now(pytz.timezone("Europe/London")))
 -        london.set_end(datetime.datetime.now(pytz.timezone("Europe/London")))
++        london.set_start(event_start.replace(tzinfo=pytz.timezone("Europe/London")))
++        london.set_end(event_end.replace(tzinfo=pytz.timezone("Europe/London")))
+ 
+         zurich = Event()
+         zurich.set_organizer("john.doe at example.org", "Doe, John")
+         zurich.add_attendee("resource-car-vw at example.org", cutype="RESOURCE")
 -        zurich.set_start(datetime.datetime.now(pytz.timezone("Europe/Zurich")))
 -        zurich.set_end(datetime.datetime.now(pytz.timezone("Europe/Zurich")))
++        zurich.set_start(event_start.replace(tzinfo=pytz.timezone("Europe/Zurich")))
++        zurich.set_end(event_end.replace(tzinfo=pytz.timezone("Europe/Zurich")))
+ 
+         london_xml = london.__str__()
+         zurich_xml = zurich.__str__()
+ 
+         #print london_xml
+         #print zurich_xml
+ 
+         london_itip = london.as_string_itip()
+         zurich_itip = zurich.as_string_itip()
+ 
+         del london, zurich
+ 
+         #print london_itip
+         #print zurich_itip
+ 
+         london_cal = icalendar.Calendar.from_ical(london_itip)
+         london = event_from_ical(london_cal.walk('VEVENT')[0].to_ical())
+ 
+         zurich_cal = icalendar.Calendar.from_ical(zurich_itip)
+         zurich = event_from_ical(zurich_cal.walk('VEVENT')[0].to_ical())
+ 
++        #fp = open(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'event-london1')), 'w')
++        #fp.write(london_xml)
++        #fp.close()
++
++        #fp = open(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'event-london2')), 'w')
++        #fp.write(london.__str__())
++        #fp.close()
++
++        #fp = open(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'event-zurich1')), 'w')
++        #fp.write(zurich_xml)
++        #fp.close()
++
++        #fp = open(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'event-zurich2')), 'w')
++        #fp.write(zurich.__str__())
++        #fp.close()
++
+         self.assertEqual(london_xml, london.__str__())
+         self.assertEqual(zurich_xml, zurich.__str__())
+ 


commit c3cb7ec328dfac4579a246753455fa592e0dcd46
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Jul 18 12:01:16 2012 +0100

    Bump pre-release

diff --git a/configure.ac b/configure.ac
index a93ef16..892e64a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_INIT([pykolab], 0.5)
-AC_SUBST([RELEASE], 0.14)
+AC_SUBST([RELEASE], 0.15)
 
 AC_CONFIG_SRCDIR(pykolab/constants.py.in)
 


commit ede89aab8d5eac1d8173347b22c3cc408d1aff39
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Jul 18 12:01:01 2012 +0100

    Update timezone test

diff --git a/tests/test-005-timezone.py b/tests/test-005-timezone.py
index 9b12c66..8110e30 100644
--- a/tests/test-005-timezone.py
+++ b/tests/test-005-timezone.py
@@ -1,5 +1,6 @@
 import datetime
 import icalendar
+import os
 import pytz
 import unittest
 
@@ -13,17 +14,23 @@ from pykolab.xml import event_from_ical
 class TestTimezone(unittest.TestCase):
 
     def test_001_timezone_conflict(self):
+        #class datetime.timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]])
+        tdelta = datetime.timedelta(0, 0, 0, 0, 0, 1)
+
+        event_start = datetime.datetime.now(pytz.timezone("UTC"))
+        event_end = datetime.datetime.now(pytz.timezone("UTC")) + tdelta
+
         london = Event()
         london.set_organizer("john.doe at example.org", "Doe, John")
         london.add_attendee("resource-car-vw at example.org", cutype="RESOURCE")
-        london.set_start(datetime.datetime.now(pytz.timezone("Europe/London")))
-        london.set_end(datetime.datetime.now(pytz.timezone("Europe/London")))
+        london.set_start(event_start.replace(tzinfo=pytz.timezone("Europe/London")))
+        london.set_end(event_end.replace(tzinfo=pytz.timezone("Europe/London")))
 
         zurich = Event()
         zurich.set_organizer("john.doe at example.org", "Doe, John")
         zurich.add_attendee("resource-car-vw at example.org", cutype="RESOURCE")
-        zurich.set_start(datetime.datetime.now(pytz.timezone("Europe/Zurich")))
-        zurich.set_end(datetime.datetime.now(pytz.timezone("Europe/Zurich")))
+        zurich.set_start(event_start.replace(tzinfo=pytz.timezone("Europe/Zurich")))
+        zurich.set_end(event_end.replace(tzinfo=pytz.timezone("Europe/Zurich")))
 
         london_xml = london.__str__()
         zurich_xml = zurich.__str__()
@@ -45,6 +52,22 @@ class TestTimezone(unittest.TestCase):
         zurich_cal = icalendar.Calendar.from_ical(zurich_itip)
         zurich = event_from_ical(zurich_cal.walk('VEVENT')[0].to_ical())
 
+        #fp = open(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'event-london1')), 'w')
+        #fp.write(london_xml)
+        #fp.close()
+
+        #fp = open(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'event-london2')), 'w')
+        #fp.write(london.__str__())
+        #fp.close()
+
+        #fp = open(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'event-zurich1')), 'w')
+        #fp.write(zurich_xml)
+        #fp.close()
+
+        #fp = open(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'event-zurich2')), 'w')
+        #fp.write(zurich.__str__())
+        #fp.close()
+
         self.assertEqual(london_xml, london.__str__())
         self.assertEqual(zurich_xml, zurich.__str__())
 


commit e389b12b4deb578ea2e57c50a24f47afc8a07981
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Jul 18 10:38:14 2012 +0100

    Generate the localhost.pem dummy certificate if it doesn't exist (#886)

diff --git a/pykolab/setup/setup_mta.py b/pykolab/setup/setup_mta.py
index 4998acf..f9202d3 100644
--- a/pykolab/setup/setup_mta.py
+++ b/pykolab/setup/setup_mta.py
@@ -252,6 +252,9 @@ result_attribute = mail
         log.error(_("Could not write out Postfix configuration file /etc/postfix/master.cf"))
         return
 
+    if os.path.isfile('/etc/pki/tls/certs/make-dummy-cert') and not os.path.isfile('/etc/pki/tls/private/localhost.pem'):
+        subprocess.call(['/etc/pki/tls/certs/make-dummy-cert', '/etc/pki/tls/private/localhost.pem'])
+
     amavisd_settings = {
             'ldap_server': 'localhost',
             'ldap_bind_dn': conf.get('ldap', 'service_bind_dn'),


commit 173da3f2b9e0b95550c20c4b36a3f0d90c0a29c7
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Jul 18 00:02:35 2012 +0100

    Bump pre-release

diff --git a/configure.ac b/configure.ac
index aa97558..a93ef16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_INIT([pykolab], 0.5)
-AC_SUBST([RELEASE], 0.13)
+AC_SUBST([RELEASE], 0.14)
 
 AC_CONFIG_SRCDIR(pykolab/constants.py.in)
 





More information about the commits mailing list