[CalendarServer-changes] [11490] CalendarServer/branches/users/glyph/hang-fix/twext/web2/test/ test_server.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Jul 5 17:43:36 PDT 2013


Revision: 11490
          http://trac.calendarserver.org//changeset/11490
Author:   glyph at apple.com
Date:     2013-07-05 17:43:36 -0700 (Fri, 05 Jul 2013)
Log Message:
-----------
Remove usage of zope.interface.implements.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/hang-fix/twext/web2/test/test_server.py

Modified: CalendarServer/branches/users/glyph/hang-fix/twext/web2/test/test_server.py
===================================================================
--- CalendarServer/branches/users/glyph/hang-fix/twext/web2/test/test_server.py	2013-07-06 00:43:34 UTC (rev 11489)
+++ CalendarServer/branches/users/glyph/hang-fix/twext/web2/test/test_server.py	2013-07-06 00:43:36 UTC (rev 11490)
@@ -5,7 +5,7 @@
 A test harness for the twext.web2 server.
 """
 
-from zope.interface import implements
+from zope.interface import implementer
 
 from twisted.python import components
 from twext.web2 import http, http_headers, iweb, server
@@ -27,7 +27,7 @@
     """
 
 
-
+ at implementer(iweb.IResource)
 class ResourceAdapter(object):
     """
     Adapter to IResource.
@@ -36,7 +36,6 @@
     L{AdaptionTestCase.test_registered} can test that such an adapter will
     be used.
     """
-    implements(iweb.IResource)
 
     def __init__(self, original):
         pass
@@ -57,7 +56,7 @@
     """
 
 
-
+ at implementer(iweb.IOldNevowResource)
 class OldResourceAdapter(object):
     """
     Adapter to IOldNevowResource.
@@ -66,7 +65,6 @@
     that L{AdaptionTestCase.test_transitive} can test that such an adapter
     will be used to allow the initial input to be adapted to IResource.
     """
-    implements(iweb.IOldNevowResource)
 
     def __init__(self, original):
         pass
@@ -100,8 +98,8 @@
         Test that the adaption to IResource of an object which provides
         IResource returns the same object.
         """
-        class Resource(object):
-            implements(iweb.IResource)
+        @implementer(iweb.IResource)
+        class Resource(object): ""
         resource = Resource()
         self.assertIdentical(iweb.IResource(resource), resource)
 
@@ -116,15 +114,17 @@
 
 
 
+ at implementer(iweb.IChanRequest)
 class TestChanRequest:
-    implements(iweb.IChanRequest)
 
     hostInfo = address.IPv4Address('TCP', 'host', 80), False
     remoteHost = address.IPv4Address('TCP', 'remotehost', 34567)
+    finished = False
 
 
     def __init__(self, site, method, prepath, uri, length=None,
                  headers=None, version=(1,1), content=None):
+        self.producer = None
         self.site = site
         self.method = method
         self.prepath = prepath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130705/82545c55/attachment.html>


More information about the calendarserver-changes mailing list