comparison test/test_dates.py @ 4072:d5e2767d4e91

Robustify Date.set.
author Stefan Seefeld <stefan@seefeld.name>
date Mon, 23 Feb 2009 19:24:57 +0000
parents 85cbaa50eba1
children f6a2bfd351ee
comparison
equal deleted inserted replaced
4071:0013d9f65e35 4072:d5e2767d4e91
35 ae(str(date), '2000-06-28.00:34:02') 35 ae(str(date), '2000-06-28.00:34:02')
36 date = Date("2000-02-27 + 2d") 36 date = Date("2000-02-27 + 2d")
37 ae(str(date), '2000-02-29.00:00:00') 37 ae(str(date), '2000-02-29.00:00:00')
38 date = Date("2001-02-27 + 2d") 38 date = Date("2001-02-27 + 2d")
39 ae(str(date), '2001-03-01.00:00:00') 39 ae(str(date), '2001-03-01.00:00:00')
40 40 date = Date("2009", add_granularity=True)
41 self.assertRaises(ValueError, Date, ". +30d", add_granularity=True)
42
41 def testDate(self): 43 def testDate(self):
42 ae = self.assertEqual 44 ae = self.assertEqual
43 date = Date("2000-04-17") 45 date = Date("2000-04-17")
44 ae(str(date), '2000-04-17.00:00:00') 46 ae(str(date), '2000-04-17.00:00:00')
45 date = Date("2000/04/17") 47 date = Date("2000/04/17")

Roundup Issue Tracker: http://roundup-tracker.org/