[Zope-Checkins] CVS: Zope/lib/python/OFS/tests - testRanges.py:1.14.4.2

Florent Guillaume fg@nuxeo.com
Sun, 22 Dec 2002 12:39:33 -0500


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

Modified Files:
      Tag: Zope-2_6-branch
	testRanges.py 
Log Message:
Ensured that all HTTP headers are sent as normal strings and not Unicode
(thanks to Lalo Martins). (Collector #561)


=== Zope/lib/python/OFS/tests/testRanges.py 1.14.4.1 => 1.14.4.2 ===
--- Zope/lib/python/OFS/tests/testRanges.py:1.14.4.1	Wed Nov 13 14:18:42 2002
+++ Zope/lib/python/OFS/tests/testRanges.py	Sun Dec 22 12:39:02 2002
@@ -164,9 +164,9 @@
         self.failUnless(content_range == expect_content_range,
             'Received incorrect Content-Range header. Expected %s, got %s' % (
                 `expect_content_range`, `content_range`))
-        self.failIf(rsp.getHeader('content-length') != len(body),
-            'Incorrect Content-Length is set! Expected %d, got %d.' % (
-                rsp.getHeader('content-length'), len(body)))
+        self.failIf(rsp.getHeader('content-length') != str(len(body)),
+            'Incorrect Content-Length is set! Expected %s, got %s.' % (
+                str(len(body)), rsp.getHeader('content-length')))
 
         self.failUnless(body == self.data[start:end],
             'Incorrect range returned, expected %s, got %s' % (
@@ -196,9 +196,9 @@
             "Incorrect Content-Type set. Expected 'multipart/%sbyteranges', "
             "got %s" % (draftprefix, ct))
         if rsp.getHeader('content-length'):
-            self.failIf(rsp.getHeader('content-length') != len(body),
-                'Incorrect Content-Length is set! Expected %d, got %d.' % (
-                    len(body), rsp.getHeader('content-length')))
+            self.failIf(rsp.getHeader('content-length') != str(len(body)),
+                'Incorrect Content-Length is set! Expected %s, got %s.' % (
+                    str(len(body)), rsp.getHeader('content-length')))
 
         # Decode the multipart message
         bodyfile = cStringIO.StringIO('Content-Type: %s\n\n%s' % (