comparison test/test_dates.py @ 1268:b34adc9bcaf2

implemented the missing Interval.__add__
author Richard Jones <richard@users.sourceforge.net>
date Fri, 11 Oct 2002 01:25:40 +0000
parents 9b910e8d987d
children 46a1951fdb14
comparison
equal deleted inserted replaced
1267:a28dfdb6c9a5 1268:b34adc9bcaf2
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.13 2002-09-10 00:19:54 richard Exp $ 18 # $Id: test_dates.py,v 1.14 2002-10-11 01:25:40 richard Exp $
19 19
20 import unittest, time 20 import unittest, time
21 21
22 from roundup.date import Date, Interval 22 from roundup.date import Date, Interval
23 23
146 ae(str(Interval('-2w 3 d ')), '- 17d') 146 ae(str(Interval('-2w 3 d ')), '- 17d')
147 ae(str(Interval(' - 1 d 2:50 ')), '- 1d 2:50') 147 ae(str(Interval(' - 1 d 2:50 ')), '- 1d 2:50')
148 ae(str(Interval(' 14:00 ')), '+ 14:00') 148 ae(str(Interval(' 14:00 ')), '+ 14:00')
149 ae(str(Interval(' 0:04:33 ')), '+ 0:04:33') 149 ae(str(Interval(' 0:04:33 ')), '+ 0:04:33')
150 150
151 # __add__
152 # XXX these are fairly arbitrary and need fixing once the __add__
153 # code handles the odd cases more correctly
154 ae(str(Interval('1y') + Interval('1y')), '+ 2y')
155 ae(str(Interval('1y') + Interval('1m')), '+ 1y 1m')
156 ae(str(Interval('1y') + Interval('2:40')), '+ 1y 2:40')
157 ae(str(Interval('1y') + Interval('- 1y')), '+')
158 ae(str(Interval('1y') + Interval('- 1m')), '+ 1y -1m')
159
151 def suite(): 160 def suite():
152 return unittest.makeSuite(DateTestCase, 'test') 161 return unittest.makeSuite(DateTestCase, 'test')
153 162
154 163
155 # vim: set filetype=python ts=4 sw=4 et si 164 # vim: set filetype=python ts=4 sw=4 et si

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