[Zope-Checkins] CVS: Zope/lib/python/ZServer/tests - test_responses.py:1.1.2.1.4.3

Chris McDonough chrism at plope.com
Wed Mar 24 02:49:07 EST 2004


Update of /cvs-repository/Zope/lib/python/ZServer/tests
In directory cvs.zope.org:/tmp/cvs-serv30859/tests

Modified Files:
      Tag: chrism-publishfile-branch
	test_responses.py 
Log Message:
Don't use a setBodyProducer API... keep the publisher the way it is.

Use an interface to denote that something is a producer.

Don't use an fcplaceholder marker class.


=== Zope/lib/python/ZServer/tests/test_responses.py 1.1.2.1.4.2 => 1.1.2.1.4.3 ===
--- Zope/lib/python/ZServer/tests/test_responses.py:1.1.2.1.4.2	Mon Mar 22 10:24:44 2004
+++ Zope/lib/python/ZServer/tests/test_responses.py	Wed Mar 24 02:49:06 2004
@@ -18,6 +18,7 @@
 from ZServer.FTPResponse import FTPResponse
 from ZServer.PCGIServer import PCGIResponse
 from ZServer.FCGIServer import FCGIResponse
+from ZServer.Producers import IZServerProducer
 import unittest
 from cStringIO import StringIO
 
@@ -45,7 +46,7 @@
         channel = DummyChannel()
         one = ZServerHTTPResponse(stdout=channel)
         one.setHeader('content-length', 5)
-        one.setBodyProducer(dummy_producer(_BODY))
+        one.setBody(dummy_producer(_BODY))
         one.outputBody()
         all = channel.all()
         lines = all.split('\r\n')
@@ -55,14 +56,10 @@
     def test_setBodyProducerFailsWithoutContentLength(self):
         one = ZServerHTTPResponse(stdout=DummyChannel())
         self.assertRaises(AssertionError,
-                          one.setBodyProducer, dummy_producer("hello"))
-
-    def test_setBadBodyProducer(self):
-        one = ZServerHTTPResponse(stdout=DummyChannel())
-        one.setHeader('content-length', 5)
-        self.assertRaises(AssertionError, one.setBodyProducer, None)
+                          one.setBody, dummy_producer("hello"))
 
 class dummy_producer:
+    __implements__ = (IZServerProducer,)
     def __init__(self, data):
         self.data = data
         self._done = 0




More information about the Zope-Checkins mailing list