--- test_strptime.py.orig 2011-05-26 14:39:00.000000000 +0200 +++ test_strptime.py 2011-05-26 14:37:35.000000000 +0200 @@ -381,6 +381,22 @@ need_escaping = ".^$*+?{}\[]|)(" self.assertTrue(_strptime._strptime_time(need_escaping, need_escaping)) + def test_isovalues(self): + # Tests conversion from year, ISO week and ISO weekday to Julian + + def test_helper(iso_tuple, ymd_tuple): + fmt_iso = '%Y %V %u' + res = _strptime._strptime(' '.join([str(i) for i in iso_tuple]), fmt_iso) + out_tuple = res[0][:3] + self.assertEqual(ymd_tuple, out_tuple, 'strptime does not handle ISO week/weekday properly (%s becomes %s, expected %s)' % (iso_tuple, out_tuple, ymd_tuple)) + + test_helper((2010, 52, 5), (2010, 12, 31)) + test_helper((2010, 52, 6), (2011, 1, 1)) + test_helper((2009, 53, 4), (2009, 12, 31)) + test_helper((2009, 53, 5), (2010, 1, 1)) + test_helper((2008, 1, 1), (2007, 12, 31)) + test_helper((2008, 1, 2), (2008, 1, 1)) + class Strptime12AMPMTests(unittest.TestCase): """Test a _strptime regression in '%I %p' at 12 noon (12 PM)"""