Mercurial > p > roundup > code
comparison test/test_dates.py @ 1505:c101d2ff5a20
fix to [SF#691071], really this time
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 10 Mar 2003 00:22:52 +0000 |
| parents | 66cc5c2819dd |
| children | 26f29449c494 |
comparison
equal
deleted
inserted
replaced
| 1503:94ec56691f07 | 1505:c101d2ff5a20 |
|---|---|
| 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.19 2003-03-06 06:12:30 richard Exp $ | 18 # $Id: test_dates.py,v 1.20 2003-03-10 00:22:21 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, Range, fixTimeOverflow |
| 23 | 23 |
| 24 class DateTestCase(unittest.TestCase): | 24 class DateTestCase(unittest.TestCase): |
| 25 def testDateInterval(self): | 25 def testDateInterval(self): |
| 26 ae = self.assertEqual | 26 ae = self.assertEqual |
| 27 date = Date("2000-06-26.00:34:02 + 2d") | 27 date = Date("2000-06-26.00:34:02 + 2d") |
| 221 i1 = Interval('- 2d') | 221 i1 = Interval('- 2d') |
| 222 i2 = Interval('1d') | 222 i2 = Interval('1d') |
| 223 l = [i1, i2]; l.sort() | 223 l = [i1, i2]; l.sort() |
| 224 ae(l, [i1, i2]) | 224 ae(l, [i1, i2]) |
| 225 | 225 |
| 226 i1 = Interval("1:20") | |
| 227 i2 = Interval("2d") | |
| 228 i3 = Interval("3:30") | |
| 229 l = [i1, i2, i3]; l.sort() | |
| 230 ae(l, [i1, i3, i2]) | |
| 226 | 231 |
| 227 def suite(): | 232 def suite(): |
| 228 return unittest.makeSuite(DateTestCase, 'test') | 233 return unittest.makeSuite(DateTestCase, 'test') |
| 229 | 234 |
| 230 | 235 |
