[Zope-Checkins] CVS: Zope/lib/python/DateTime/tests - testDateTime.py:1.10

Andreas Jung andreas@digicool.com
Mon, 4 Mar 2002 10:59:05 -0500


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

Modified Files:
	testDateTime.py 
Log Message:
testJulianWeek() now reads the gzipped test file


=== Zope/lib/python/DateTime/tests/testDateTime.py 1.9 => 1.10 ===
         """ check JulianDayWeek function """
 
-        lines  = open('julian_testdata.txt').readlines()
-        
+        try:
+            import gzip
+        except ImportError:
+            print "Warning: testJulianWeek disabled: module gzip not found"
+            return 0
+
+        lines  = gzip.GzipFile('julian_testdata.txt.gz').readlines()
+    
         for line in lines:
             d = DateTime(line[:10])
             result_from_mx=tuple(map(int, line[12:-2].split(',')))
             self.assertEqual(result_from_mx[1], d.week())
-         
 
 
 def test_suite():