[Checkins] SVN: zope.app.http/trunk/src/zope/app/http/ More cleanups of zope.app.testing.
Martijn Faassen
faassen at startifact.com
Wed Apr 14 10:40:14 EDT 2010
Log message for revision 110898:
More cleanups of zope.app.testing.
Changed:
U zope.app.http/trunk/src/zope/app/http/exception/tests/test_methodnotallowed.py
D zope.app.http/trunk/src/zope/app/http/testing.py
U zope.app.http/trunk/src/zope/app/http/tests/test_functional_put.py
-=-
Modified: zope.app.http/trunk/src/zope/app/http/exception/tests/test_methodnotallowed.py
===================================================================
--- zope.app.http/trunk/src/zope/app/http/exception/tests/test_methodnotallowed.py 2010-04-14 14:19:36 UTC (rev 110897)
+++ zope.app.http/trunk/src/zope/app/http/exception/tests/test_methodnotallowed.py 2010-04-14 14:40:14 UTC (rev 110898)
@@ -22,8 +22,7 @@
from zope.publisher.http import HTTPRequest
from zope.publisher.interfaces.http import IHTTPRequest
-from zope.app.testing import ztapi
-from zope.app.testing.placelesssetup import PlacelessSetup
+from zope.component import provideAdapter
class I(Interface):
@@ -48,17 +47,16 @@
pass
-class TestMethodNotAllowedView(PlacelessSetup, TestCase):
+class TestMethodNotAllowedView(TestCase):
def setUp(self):
from zope.publisher.interfaces.http import IHTTPRequest
- PlacelessSetup.setUp(self)
- ztapi.provideView(I, IHTTPRequest, Interface, 'GET', GetView)
- ztapi.provideView(I, IHTTPRequest, Interface, 'DELETE', DeleteView)
- ztapi.provideView(I, IHTTPRequest, Interface, 'irrelevant', GetView)
- ztapi.provideView(I, IHTTPRequest, Interface, 'also_irr.', DeleteView)
-
+ provideAdapter(GetView, (I, IHTTPRequest), Interface, 'GET')
+ provideAdapter(DeleteView, (I, IHTTPRequest), Interface, 'DELETE')
+ provideAdapter(GetView, (I, IHTTPRequest), Interface, 'irrelevant')
+ provideAdapter(DeleteView, (I, IHTTPRequest), Interface, 'also_irr.')
+
from zope.publisher.interfaces import IDefaultViewName
from zope.publisher.interfaces.browser import IBrowserRequest
#do the same as defaultView would for something like:
@@ -67,8 +65,8 @@
# name="index.html"
# />
- ztapi.provideAdapter((I, IBrowserRequest), IDefaultViewName, u'index.html')
-
+ provideAdapter(u'index.html', (I, IBrowserRequest), IDefaultViewName)
+
def test(self):
from zope.publisher.interfaces.http import MethodNotAllowed
from zope.app.http.exception.methodnotallowed \
Deleted: zope.app.http/trunk/src/zope/app/http/testing.py
===================================================================
--- zope.app.http/trunk/src/zope/app/http/testing.py 2010-04-14 14:19:36 UTC (rev 110897)
+++ zope.app.http/trunk/src/zope/app/http/testing.py 2010-04-14 14:40:14 UTC (rev 110898)
@@ -1,26 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""zope.app.http common test related classes/functions/objects.
-
-$Id$
-"""
-
-__docformat__ = "reStructuredText"
-
-import os
-from zope.app.testing.functional import ZCMLLayer
-
-AppHttpLayer = ZCMLLayer(
- os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
- __name__, 'AppHttpLayer', allow_teardown=True)
Modified: zope.app.http/trunk/src/zope/app/http/tests/test_functional_put.py
===================================================================
--- zope.app.http/trunk/src/zope/app/http/tests/test_functional_put.py 2010-04-14 14:19:36 UTC (rev 110897)
+++ zope.app.http/trunk/src/zope/app/http/tests/test_functional_put.py 2010-04-14 14:40:14 UTC (rev 110898)
@@ -28,6 +28,7 @@
# PUT something for the first time
out = http(r"""PUT /testfile.txt HTTP/1.1
Authorization: Basic globalmgr:globalmgrpw
+X-Zope-Handle-Errors: False
Content-Length: 20
Content-Type: text/plain
More information about the checkins
mailing list