From cb8b538e27ecf804a0855d25787301a9b621123e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 2 Jun 2010 16:46:06 +0000 Subject: [PATCH] Monotone-Parent: 3774742a6943dc4914fba97472a150d427c3f883 Monotone-Revision: 8c0c5f08cd0bdb1e303b9c4cffedc1940941869e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-06-02T16:46:06 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ Tests/Integration/webdavlib.py | 27 ++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 912bb52a3..2e2f6c2ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-06-02 Wolfgang Sourdeau + * Tests/Integration/webdavlib.py (HTTPPUT.__init__): added the + "content_type" and "exclusive" optional parameters. The latter + implies the use of the "if-none-match" header. + * SoObjects/SOGo/WORequest+SOGo.m (-handledByDefaultHandler): fixed a bug where the -requestHandlerKey method would be invoked on the "request" (NGHttpRequest) ivar rather than on self. diff --git a/Tests/Integration/webdavlib.py b/Tests/Integration/webdavlib.py index 50c672b9f..eee5eb243 100644 --- a/Tests/Integration/webdavlib.py +++ b/Tests/Integration/webdavlib.py @@ -150,13 +150,24 @@ class HTTPQuery(HTTPSimpleQuery): class HTTPPUT(HTTPQuery): method = "PUT" - def __init__(self, url, content): + def __init__(self, url, content, + content_type="application/octet-stream", + exclusive=False): HTTPQuery.__init__(self, url) self.content = content + self.content_type = content_type + self.exclusive = exclusive def render(self): return self.content + def prepare_headers(self): + headers = HTTPQuery.prepare_headers(self) + if self.exclusive: + headers["if-none-match"] = "*" + + return headers + class HTTPPOST(HTTPPUT): method = "POST" @@ -260,20 +271,6 @@ class WebDAVMOVE(WebDAVQuery): headers["Host"] = self.host return headers -class WebDAVPUT(WebDAVQuery): - method = "PUT" - - def __init__(self, url, content): - WebDAVQuery.__init__(self, url) - self.content_type = "text/plain; charset=utf-8" - self.content = content - - def prepare_headers(self): - return WebDAVQuery.prepare_headers(self) - - def render(self): - return self.content - class WebDAVPrincipalPropertySearch(WebDAVREPORT): def __init__(self, url, properties, matches): WebDAVQuery.__init__(self, url)