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)