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

Florent Guillaume fg@nuxeo.com
Sun, 22 Dec 2002 13:32:16 -0500


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

Modified Files:
	testRanges.py 
Log Message:
Merge from Zope-2_6-branch:

Ensured that all HTTP headers are sent as normal strings and not Unicode.


=== Zope/lib/python/OFS/tests/testRanges.py 1.15 => 1.16 ===
--- Zope/lib/python/OFS/tests/testRanges.py:1.15	Wed Nov 13 14:17:44 2002
+++ Zope/lib/python/OFS/tests/testRanges.py	Sun Dec 22 13:31:45 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' % (