[Zope-Checkins] CVS: Zope/lib/python/DateTime/tests - testDateTime.py:1.14
Torped Strategy and Communications
info@torped.se
Tue, 15 Oct 2002 14:14:49 -0400
Update of /cvs-repository/Zope/lib/python/DateTime/tests
In directory cvs.zope.org:/tmp/cvs-serv6504/lib/python/DateTime/tests
Modified Files:
testDateTime.py
Log Message:
Put back a test that was mistakenly removed.
=== Zope/lib/python/DateTime/tests/testDateTime.py 1.13 => 1.14 ===
--- Zope/lib/python/DateTime/tests/testDateTime.py:1.13 Tue Oct 15 13:53:37 2002
+++ Zope/lib/python/DateTime/tests/testDateTime.py Tue Oct 15 14:14:49 2002
@@ -217,6 +217,23 @@
isoDt = DateTime('2002-05-02T08:00:00Z-04:00')
self.assertEqual( ref1, isoDt)
+ def testJulianWeek(self):
+ """ check JulianDayWeek function """
+
+ try:
+ import gzip
+ except ImportError:
+ print "Warning: testJulianWeek disabled: module gzip not found"
+ return 0
+
+ lines = gzip.GzipFile(os.path.join(__basedir__,
+ '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 testRFC822(self):
'''rfc822 conversion'''
isDST = time.localtime(time.time())[8]
@@ -235,11 +252,7 @@
# Create a non-local date time and test
dt = DateTime('2002-05-02T08:00:00Z'+wrongzone)
self.assertEqual(dt.rfc822(), 'Thu, 02 May 2002 08:00:00 -0000')
-
-
- #print dt.rfc822()
-
def test_suite():
return unittest.makeSuite(DateTimeTests)