summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorniemeyer <>2010-03-30 00:42:25 +0000
committerniemeyer <>2010-03-30 00:42:25 +0000
commite9f0b2450ce1073ecc7b78a6f8631187bc6d018a (patch)
tree4c53bcf7b529c00004d5b08f1f310c5dc9d1fa28 /test.py
parent27bf3ec9d045b3b2ceee376f3b662f057836a76f (diff)
downloaddateutil-e9f0b2450ce1073ecc7b78a6f8631187bc6d018a.tar.gz
Adam Ryan reported a problem in the relativedelta implementation which
affected the yearday parameter in the month of January specifically. This has been unittested and fixed.
Diffstat (limited to 'test.py')
-rw-r--r--test.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test.py b/test.py
index ed23c03..049fede 100644
--- a/test.py
+++ b/test.py
@@ -131,6 +131,11 @@ class RelativeDeltaTest(unittest.TestCase):
self.assertEqual(self.today+relativedelta(yearday=261),
date(2003, 9, 18))
+ def testYearDayBug(self):
+ # Tests a problem reported by Adam Ryan.
+ self.assertEqual(date(2010, 1, 1)+relativedelta(yearday=15),
+ date(2010, 1, 15))
+
def testNonLeapYearDay(self):
self.assertEqual(date(2003, 1, 1)+relativedelta(nlyearday=260),
date(2003, 9, 17))