[Zope3-checkins] CVS: Zope3/src/zope/publisher/tests - publication.py:1.2.26.1 test_http.py:1.15.12.1 test_publisher.py:1.4.14.1 test_xmlrpcmethodpublisher.py:1.4.14.1 views.py:1.2.26.1 xmlrpcviews.py:1.2.26.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:22 -0400
Update of /cvs-repository/Zope3/src/zope/publisher/tests
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/publisher/tests
Modified Files:
Tag: cw-mail-branch
publication.py test_http.py test_publisher.py
test_xmlrpcmethodpublisher.py views.py xmlrpcviews.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/publisher/tests/publication.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/publisher/tests/publication.py:1.2 Wed Dec 25 09:15:19 2002
+++ Zope3/src/zope/publisher/tests/publication.py Sun Jun 22 10:23:51 2003
@@ -13,10 +13,11 @@
##############################################################################
from zope.publisher.interfaces import IPublication
+from zope.interface import implements
class TestPublication:
- __implements__ = IPublication
+ implements(IPublication)
def afterCall(self, request):
'''See interface IPublication'''
=== Zope3/src/zope/publisher/tests/test_http.py 1.15 => 1.15.12.1 ===
--- Zope3/src/zope/publisher/tests/test_http.py:1.15 Mon Apr 28 09:14:22 2003
+++ Zope3/src/zope/publisher/tests/test_http.py Sun Jun 22 10:23:51 2003
@@ -25,6 +25,11 @@
from StringIO import StringIO
+class UserStub:
+ def __init__(self, id):
+ self._id = id
+ def getId(self):
+ return self._id
class HTTPTests(unittest.TestCase):
@@ -197,6 +202,15 @@
req = self._createRequest(env)
lpw = req._authUserPW()
self.assertEquals(lpw, (login, password))
+
+ def testSetUser(self):
+ class HTTPTaskStub:
+ def setAuthUserName(self, name):
+ self.auth_user_name = name
+ task = HTTPTaskStub()
+ req = self._createRequest(outstream=task)
+ req.setUser(UserStub("jim"))
+ self.assertEquals(req.response._outstream.auth_user_name, "jim")
def testIPresentationRequest(self):
# test the IView request
=== Zope3/src/zope/publisher/tests/test_publisher.py 1.4 => 1.4.14.1 ===
--- Zope3/src/zope/publisher/tests/test_publisher.py:1.4 Fri Apr 11 08:55:41 2003
+++ Zope3/src/zope/publisher/tests/test_publisher.py Sun Jun 22 10:23:51 2003
@@ -25,7 +25,7 @@
from zope.publisher.interfaces import IPublication
from zope.interface.verify import verifyClass
-from zope.interface.implements import instancesOfObjectImplements
+from zope.interface import implementedBy
from StringIO import StringIO
@@ -80,7 +80,7 @@
DefaultPublication(self.app)))
def testInterfacesVerify(self):
- for interface in instancesOfObjectImplements(DefaultPublication):
+ for interface in implementedBy(DefaultPublication):
verifyClass(interface, DefaultPublication)
def testTraversalToItem(self):
=== Zope3/src/zope/publisher/tests/test_xmlrpcmethodpublisher.py 1.4 => 1.4.14.1 ===
--- Zope3/src/zope/publisher/tests/test_xmlrpcmethodpublisher.py:1.4 Fri Apr 11 08:55:41 2003
+++ Zope3/src/zope/publisher/tests/test_xmlrpcmethodpublisher.py Sun Jun 22 10:23:51 2003
@@ -17,7 +17,7 @@
from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
from zope.interface.verify import verifyClass
-from zope.interface.implements import instancesOfObjectImplements
+from zope.interface import implementedBy
class ContentStub:
pass
@@ -36,16 +36,14 @@
self.failUnless(IXMLRPCPublisher.isImplementedBy(self.pres))
def testInterfacesVerify(self):
- for interface in instancesOfObjectImplements(Presentation):
+ for interface in implementedBy(Presentation):
verifyClass(interface, Presentation)
def testXMLRPCTraverseIndex(self):
- self.assertEquals(self.pres.publishTraverse(None, 'index'),
- 'index')
+ self.assertEquals(self.pres.publishTraverse(None, 'index'), 'index')
def testXMLRPCTraverseAction(self):
- self.assertEquals(self.pres.publishTraverse(None, 'action'),
- 'action')
+ self.assertEquals(self.pres.publishTraverse(None, 'action'), 'action')
def testXMLRPCTraverseNotFound(self):
self.failUnlessRaises(AttributeError, self.pres.publishTraverse,
=== Zope3/src/zope/publisher/tests/views.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/publisher/tests/views.py:1.2 Wed Dec 25 09:15:19 2002
+++ Zope3/src/zope/publisher/tests/views.py Sun Jun 22 10:23:51 2003
@@ -16,7 +16,7 @@
Revision information: $Id$
"""
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.publisher.browser import BrowserView
from zope.publisher.interfaces.browser import IBrowserPresentation
@@ -27,7 +27,7 @@
class VZMI(V1): pass
class R1:
- __implements__ = IBrowserPresentation
+ implements(IBrowserPresentation)
def __init__(self, request): self.request = request
class RZMI(R1):
=== Zope3/src/zope/publisher/tests/xmlrpcviews.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/publisher/tests/xmlrpcviews.py:1.2 Wed Dec 25 09:15:19 2002
+++ Zope3/src/zope/publisher/tests/xmlrpcviews.py Sun Jun 22 10:23:51 2003
@@ -16,13 +16,13 @@
Revision information: $Id$
"""
-from zope.interface import Interface
+from zope.interface import Interface, implements
from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
class IC(Interface): pass
class V1:
- __implements__ = IXMLRPCPublisher
+ implements(IXMLRPCPublisher)
def __init__(self, context, request):
self.context = context
@@ -35,7 +35,7 @@
def __init__(self, request):
self.request = request
- __implements__ = IXMLRPCPublisher
+ implements(IXMLRPCPublisher)
class RZMI(R1):
pass