Mercurial > p > roundup > code
comparison test/test_dates.py @ 1494:66cc5c2819dd
oops, Interval sorting ignored sign
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 06 Mar 2003 06:12:30 +0000 |
| parents | 37a1906f4454 |
| children | c101d2ff5a20 |
comparison
equal
deleted
inserted
replaced
| 1493:e07c304503c3 | 1494:66cc5c2819dd |
|---|---|
| 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.18 2003-03-06 02:33:57 richard Exp $ | 18 # $Id: test_dates.py,v 1.19 2003-03-06 06:12:30 richard Exp $ |
| 19 | 19 |
| 20 import unittest, time | 20 import unittest, time |
| 21 | 21 |
| 22 from roundup.date import Date, Interval, fixTimeOverflow | 22 from roundup.date import Date, Interval, fixTimeOverflow |
| 23 | 23 |
| 208 ae = self.assertEqual | 208 ae = self.assertEqual |
| 209 ae(str(Interval('1y')/2), '+ 6m') | 209 ae(str(Interval('1y')/2), '+ 6m') |
| 210 ae(str(Interval('1:00')/2), '+ 0:30') | 210 ae(str(Interval('1:00')/2), '+ 0:30') |
| 211 ae(str(Interval('00:01')/2), '+ 0:00:30') | 211 ae(str(Interval('00:01')/2), '+ 0:00:30') |
| 212 | 212 |
| 213 def testSorting(self): | |
| 214 ae = self.assertEqual | |
| 215 i1 = Interval('1y') | |
| 216 i2 = Interval('1d') | |
| 217 l = [i1, i2]; l.sort() | |
| 218 ae(l, [i2, i1]) | |
| 219 l = [i2, i1]; l.sort() | |
| 220 ae(l, [i2, i1]) | |
| 221 i1 = Interval('- 2d') | |
| 222 i2 = Interval('1d') | |
| 223 l = [i1, i2]; l.sort() | |
| 224 ae(l, [i1, i2]) | |
| 225 | |
| 226 | |
| 213 def suite(): | 227 def suite(): |
| 214 return unittest.makeSuite(DateTestCase, 'test') | 228 return unittest.makeSuite(DateTestCase, 'test') |
| 215 | 229 |
| 216 | 230 |
| 217 # vim: set filetype=python ts=4 sw=4 et si | 231 # vim: set filetype=python ts=4 sw=4 et si |
