comparison test/test_dates.py @ 3586:f47bddab5a49

date spec wasn't allowing week intervals
author Richard Jones <richard@users.sourceforge.net>
date Fri, 03 Mar 2006 02:02:50 +0000
parents 9c080e19f307
children a9126b8033c5
comparison
equal deleted inserted replaced
3585:438adf66eb1a 3586:f47bddab5a49
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: test_dates.py,v 1.37 2006-01-13 00:22:17 richard Exp $ 18 # $Id: test_dates.py,v 1.38 2006-03-03 02:02:50 richard Exp $
19 from __future__ import nested_scopes 19 from __future__ import nested_scopes
20 20
21 import unittest, time 21 import unittest, time
22 22
23 from roundup.date import Date, Interval, Range, fixTimeOverflow 23 from roundup.date import Date, Interval, Range, fixTimeOverflow
81 ae(str(date), '%s-11-07.14:32:43'%y) 81 ae(str(date), '%s-11-07.14:32:43'%y)
82 date = Date("14:25", -5) 82 date = Date("14:25", -5)
83 ae(str(date), '%s-%02d-%02d.19:25:00'%(y, m, d)) 83 ae(str(date), '%s-%02d-%02d.19:25:00'%(y, m, d))
84 date = Date("8:47:11", -5) 84 date = Date("8:47:11", -5)
85 ae(str(date), '%s-%02d-%02d.13:47:11'%(y, m, d)) 85 ae(str(date), '%s-%02d-%02d.13:47:11'%(y, m, d))
86
87 # just make sure we parse these, m'kay?
88 date = Date('-1d')
89 date = Date('-1w')
90 date = Date('-1m')
91 date = Date('-1y')
86 92
87 def testOffsetRandom(self): 93 def testOffsetRandom(self):
88 ae = self.assertEqual 94 ae = self.assertEqual
89 # XXX unsure of the usefulness of these, they're pretty random 95 # XXX unsure of the usefulness of these, they're pretty random
90 date = Date('2000-01-01') + Interval('- 2y 2m') 96 date = Date('2000-01-01') + Interval('- 2y 2m')

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