[Zope-Checkins] CVS: Zope/lib/python/DateTime/tests - julian_testdata.txt:1.1 testDateTime.py:1.9
Andreas Jung
andreas@digicool.com
Mon, 4 Mar 2002 10:52:39 -0500
Update of /cvs-repository/Zope/lib/python/DateTime/tests
In directory cvs.zope.org:/tmp/cvs-serv19573
Modified Files:
testDateTime.py
Added Files:
julian_testdata.txt
Log Message:
Collector #234: added functions JulianDay() and week() to calculate
the Julian day and the week in the current year based on the Julian
calendar.
=== Added File Zope/lib/python/DateTime/tests/julian_testdata.txt === (18162/18262 lines abridged)
1970-01-01 (1970, 1, 4)
1970-01-02 (1970, 1, 5)
1970-01-03 (1970, 1, 6)
1970-01-04 (1970, 1, 7)
1970-01-05 (1970, 2, 1)
1970-01-06 (1970, 2, 2)
1970-01-07 (1970, 2, 3)
1970-01-08 (1970, 2, 4)
1970-01-09 (1970, 2, 5)
1970-01-10 (1970, 2, 6)
1970-01-11 (1970, 2, 7)
1970-01-12 (1970, 3, 1)
1970-01-13 (1970, 3, 2)
1970-01-14 (1970, 3, 3)
1970-01-15 (1970, 3, 4)
1970-01-16 (1970, 3, 5)
1970-01-17 (1970, 3, 6)
1970-01-18 (1970, 3, 7)
1970-01-19 (1970, 4, 1)
1970-01-20 (1970, 4, 2)
1970-01-21 (1970, 4, 3)
1970-01-22 (1970, 4, 4)
1970-01-23 (1970, 4, 5)
1970-01-24 (1970, 4, 6)
1970-01-25 (1970, 4, 7)
1970-01-26 (1970, 5, 1)
1970-01-27 (1970, 5, 2)
1970-01-28 (1970, 5, 3)
1970-01-29 (1970, 5, 4)
1970-01-30 (1970, 5, 5)
1970-01-31 (1970, 5, 6)
1970-02-01 (1970, 5, 7)
1970-02-02 (1970, 6, 1)
1970-02-03 (1970, 6, 2)
1970-02-04 (1970, 6, 3)
1970-02-05 (1970, 6, 4)
1970-02-06 (1970, 6, 5)
1970-02-07 (1970, 6, 6)
1970-02-08 (1970, 6, 7)
1970-02-09 (1970, 7, 1)
1970-02-10 (1970, 7, 2)
1970-02-11 (1970, 7, 3)
1970-02-12 (1970, 7, 4)
1970-02-13 (1970, 7, 5)
1970-02-14 (1970, 7, 6)
1970-02-15 (1970, 7, 7)
1970-02-16 (1970, 8, 1)
1970-02-17 (1970, 8, 2)
1970-02-18 (1970, 8, 3)
1970-02-19 (1970, 8, 4)
[-=- -=- -=- 18162 lines omitted -=- -=- -=-]
2019-11-12 (2019, 46, 2)
2019-11-13 (2019, 46, 3)
2019-11-14 (2019, 46, 4)
2019-11-15 (2019, 46, 5)
2019-11-16 (2019, 46, 6)
2019-11-17 (2019, 46, 7)
2019-11-18 (2019, 47, 1)
2019-11-19 (2019, 47, 2)
2019-11-20 (2019, 47, 3)
2019-11-21 (2019, 47, 4)
2019-11-22 (2019, 47, 5)
2019-11-23 (2019, 47, 6)
2019-11-24 (2019, 47, 7)
2019-11-25 (2019, 48, 1)
2019-11-26 (2019, 48, 2)
2019-11-27 (2019, 48, 3)
2019-11-28 (2019, 48, 4)
2019-11-29 (2019, 48, 5)
2019-11-30 (2019, 48, 6)
2019-12-01 (2019, 48, 7)
2019-12-02 (2019, 49, 1)
2019-12-03 (2019, 49, 2)
2019-12-04 (2019, 49, 3)
2019-12-05 (2019, 49, 4)
2019-12-06 (2019, 49, 5)
2019-12-07 (2019, 49, 6)
2019-12-08 (2019, 49, 7)
2019-12-09 (2019, 50, 1)
2019-12-10 (2019, 50, 2)
2019-12-11 (2019, 50, 3)
2019-12-12 (2019, 50, 4)
2019-12-13 (2019, 50, 5)
2019-12-14 (2019, 50, 6)
2019-12-15 (2019, 50, 7)
2019-12-16 (2019, 51, 1)
2019-12-17 (2019, 51, 2)
2019-12-18 (2019, 51, 3)
2019-12-19 (2019, 51, 4)
2019-12-20 (2019, 51, 5)
2019-12-21 (2019, 51, 6)
2019-12-22 (2019, 51, 7)
2019-12-23 (2019, 52, 1)
2019-12-24 (2019, 52, 2)
2019-12-25 (2019, 52, 3)
2019-12-26 (2019, 52, 4)
2019-12-27 (2019, 52, 5)
2019-12-28 (2019, 52, 6)
2019-12-29 (2019, 52, 7)
2019-12-30 (2020, 1, 1)
2019-12-31 (2020, 1, 2)
=== Zope/lib/python/DateTime/tests/testDateTime.py 1.8 => 1.9 ===
+ def testJulianWeek(self):
+ """ check JulianDayWeek function """
+
+ lines = open('julian_testdata.txt').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():
return unittest.makeSuite(DateTimeTests)