diff 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
line wrap: on
line diff
--- a/test/test_dates.py	Thu Mar 06 06:06:49 2003 +0000
+++ b/test/test_dates.py	Thu Mar 06 06:12:30 2003 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: test_dates.py,v 1.18 2003-03-06 02:33:57 richard Exp $ 
+# $Id: test_dates.py,v 1.19 2003-03-06 06:12:30 richard Exp $ 
 
 import unittest, time
 
@@ -210,6 +210,20 @@
         ae(str(Interval('1:00')/2), '+ 0:30')
         ae(str(Interval('00:01')/2), '+ 0:00:30')
 
+    def testSorting(self):
+        ae = self.assertEqual
+        i1 = Interval('1y')
+        i2 = Interval('1d')
+        l = [i1, i2]; l.sort()
+        ae(l, [i2, i1])
+        l = [i2, i1]; l.sort()
+        ae(l, [i2, i1])
+        i1 = Interval('- 2d')
+        i2 = Interval('1d')
+        l = [i1, i2]; l.sort()
+        ae(l, [i1, i2])
+
+
 def suite():
    return unittest.makeSuite(DateTestCase, 'test')
 

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