Commit 6bf53b2b authored by Andreas Jung's avatar Andreas Jung

testJulianWeek() now reads the gzipped test file

parent 11fc0a06
...@@ -221,7 +221,13 @@ class DateTimeTests (unittest.TestCase): ...@@ -221,7 +221,13 @@ class DateTimeTests (unittest.TestCase):
def testJulianWeek(self): def testJulianWeek(self):
""" check JulianDayWeek function """ """ 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: for line in lines:
d = DateTime(line[:10]) d = DateTime(line[:10])
...@@ -229,7 +235,6 @@ class DateTimeTests (unittest.TestCase): ...@@ -229,7 +235,6 @@ class DateTimeTests (unittest.TestCase):
self.assertEqual(result_from_mx[1], d.week()) self.assertEqual(result_from_mx[1], d.week())
def test_suite(): def test_suite():
return unittest.makeSuite(DateTimeTests) return unittest.makeSuite(DateTimeTests)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment