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

Martijn Pieters mj@zope.com
Wed, 21 Aug 2002 17:18:29 -0400


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

Modified Files:
	testRanges.py 
Log Message:
Merge fix for Zope Collector issue #530 from 2.5 branch; do not optimize
byte ranges because Acrobat Reader for Windows chokes when overlapping
ranges have been merged.


=== Zope/lib/python/OFS/tests/testRanges.py 1.13 => 1.14 ===
--- Zope/lib/python/OFS/tests/testRanges.py:1.13	Wed Aug 14 17:41:16 2002
+++ Zope/lib/python/OFS/tests/testRanges.py	Wed Aug 21 17:17:58 2002
@@ -303,7 +303,7 @@
 
     # Multiple ranges
     def testAdjacentRanges(self):
-        self.expectMultipleRanges('21-25,10-20', [(10, 21), (21, 26)])
+        self.expectMultipleRanges('21-25,10-20', [(21, 26), (10, 21)])
 
     def testMultipleRanges(self):
         self.expectMultipleRanges('3-7,10-15', [(3, 8), (10, 16)])
@@ -314,7 +314,13 @@
     def testMultipleRangesBigFile(self):
         self.uploadBigFile()
         self.expectMultipleRanges('3-700,10-15,-10000',
-            [(3, 701), (len(self.data) - 10000, len(self.data))])
+            [(3, 701), (10, 16), (len(self.data) - 10000, len(self.data))])
+
+    def testMultipleRangesBigFileOutOfOrder(self):
+        self.uploadBigFile()
+        self.expectMultipleRanges('10-15,-10000,70000-80000', 
+            [(10, 16), (len(self.data) - 10000, len(self.data)),
+             (70000, 80001)])
 
     def testMultipleRangesBigFileEndOverflow(self):
         self.uploadBigFile()
@@ -327,10 +333,10 @@
     def testIllegalIfRange(self):
         # We assume that an illegal if-range is to be ignored, just like an
         # illegal if-modified since.
-        self.expectSingleRange('21-25,10-21', 10, 26, if_range='garbage')
+        self.expectSingleRange('10-25', 10, 26, if_range='garbage')
 
     def testEqualIfRangeDate(self):
-        self.expectSingleRange('21-25,10-21', 10, 26,
+        self.expectSingleRange('10-25', 10, 26,
             if_range=self.createLastModifiedDate())
 
     def testIsModifiedIfRangeDate(self):
@@ -338,15 +344,15 @@
             if_range=self.createLastModifiedDate(offset=-100))
 
     def testIsNotModifiedIfRangeDate(self):
-        self.expectSingleRange('21-25,10-21', 10, 26,
+        self.expectSingleRange('10-25', 10, 26,
             if_range=self.createLastModifiedDate(offset=100))
 
     def testEqualIfRangeEtag(self):
-        self.expectSingleRange('21-25,10-21', 10, 26,
+        self.expectSingleRange('10-25', 10, 26,
             if_range=self.file.http__etag())
 
     def testNotEqualIfRangeEtag(self):
-        self.expectOK('21-25,10-20',
+        self.expectOK('10-25',
             if_range=self.file.http__etag() + 'bar')