From eceffe862ea696094f966c9e37d04d285986bc77 Mon Sep 17 00:00:00 2001 From: Jean Raby Date: Thu, 2 Feb 2012 18:05:36 +0000 Subject: [PATCH] Drop pytz, use dateutil.tz. Bring in small fixes from trunk Monotone-Parent: 18bd3484373fa731cf9a3ac7ca3ce35afbf03cdd Monotone-Revision: 1efb09bf023898a5a0088c9ba29ca00f1a304611 Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-02-02T18:05:36 --- Tests/Integration/GNUmakefile.preamble | 2 ++ Tests/Integration/README | 2 +- Tests/Integration/test-caldav-scheduling.py | 4 ++-- Tests/Integration/webdavlib.py | 20 ++++++++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Tests/Integration/GNUmakefile.preamble b/Tests/Integration/GNUmakefile.preamble index 4d20462de..90cc86a41 100644 --- a/Tests/Integration/GNUmakefile.preamble +++ b/Tests/Integration/GNUmakefile.preamble @@ -15,3 +15,5 @@ ADDITIONAL_LIB_DIRS += \ -L../../SOPE/GDLContentStore/$(GNUSTEP_OBJ_DIR)/ -lGDLContentStore \ -L../../SOPE/NGCards/$(GNUSTEP_OBJ_DIR)/ -lNGCards \ -L/usr/local/lib -L/usr/lib -lEOControl -lNGStreams -lNGMime -lNGExtensions + +ADDITIONAL_LDFLAGS += -Wl,--no-as-needed diff --git a/Tests/Integration/README b/Tests/Integration/README index ca98c90c0..fdbf331c7 100644 --- a/Tests/Integration/README +++ b/Tests/Integration/README @@ -1,7 +1,7 @@ setup ----- -(you need "python-simplejson", "python-xml", "python-vobject" and "python-m2crypto" +(you need "python-simplejson", "python-xml", "python-vobject", "python-dateutil" and "python-m2crypto" in order to run the scripts on Debian) 1) copy config.py.in to config.py (make sure to never EVER add it to monotone) diff --git a/Tests/Integration/test-caldav-scheduling.py b/Tests/Integration/test-caldav-scheduling.py index a9fb92249..1fbd92b8e 100755 --- a/Tests/Integration/test-caldav-scheduling.py +++ b/Tests/Integration/test-caldav-scheduling.py @@ -8,10 +8,10 @@ from config import hostname, port, username, password, \ resource_no_overbook, resource_can_overbook import datetime +import dateutil.tz import sogotests import sys import time -import pytz import unittest import utilities import vobject @@ -143,7 +143,7 @@ class CalDAVITIPDelegationTest(unittest.TestCase): vevent.add('summary').value = summary vevent.add('transp').value = transparency[transp] - now = datetime.datetime.now(pytz.timezone("America/Montreal")) + now = datetime.datetime.now(dateutil.tz.gettz("America/Montreal")) startdate = vevent.add('dtstart') startdate.value = now enddate = vevent.add('dtend') diff --git a/Tests/Integration/webdavlib.py b/Tests/Integration/webdavlib.py index eee5eb243..46bc6d317 100644 --- a/Tests/Integration/webdavlib.py +++ b/Tests/Integration/webdavlib.py @@ -30,6 +30,7 @@ import sys xmlns_dav = "DAV:" xmlns_caldav = "urn:ietf:params:xml:ns:caldav" +xmlns_carddav = "urn:ietf:params:xml:ns:carddav" xmlns_inversedav = "urn:inverse:params:xml:ns:inverse-dav" url_re = None @@ -401,6 +402,25 @@ class CalDAVCalendarQuery(WebDAVREPORT): filter_node.append(cal_filter_node) self.top_node.append(filter_node) +class CardDAVAddressBookQuery(WebDAVREPORT): + def __init__(self, url, properties, searchProperty = None, searchValue = None): + WebDAVQuery.__init__(self, url) + query_tag = self.ns_mgr.register("addressbook-query", xmlns_carddav) + ns_key = self.ns_mgr.xmlns[xmlns_carddav] + self.top_node = _WD_XMLTreeElement(query_tag) + if properties is not None and len(properties) > 0: + self._initProperties(properties) + + if searchProperty is not None: + filter_node = _WD_XMLTreeElement("%s:filter" % ns_key) + self.top_node.append(filter_node) + propfilter_node = _WD_XMLTreeElement("%s:prop-filter" % ns_key, { "name": searchProperty }) + filter_node.append(propfilter_node) + match_node = _WD_XMLTreeElement("%s:text-match" % ns_key, + { "collation": "i;unicasemap", "match-type": "starts-with" }) + propfilter_node.append(match_node) + match_node.appendSubtree(None, searchValue) + class MailDAVMailQuery(WebDAVREPORT): def __init__(self, url, properties, filters = None, sort = None, ascending = True):