summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_strptime.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-01-25 20:22:02 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-01-25 20:22:02 (GMT)
commit07e1db317db4605acd5295f02dcfa4943d4a7054 (patch)
tree758c825f6324be4a1e404044af2697ed8b1d54b1 /Lib/test/test_strptime.py
parent27b4c8b23cf1493d5c00316ca78363189d635db5 (diff)
downloadcpython-07e1db317db4605acd5295f02dcfa4943d4a7054.zip
cpython-07e1db317db4605acd5295f02dcfa4943d4a7054.tar.gz
cpython-07e1db317db4605acd5295f02dcfa4943d4a7054.tar.bz2
Fix time.strptime's %U support. Basically rewrote the algorithm to be more
generic so that one only has to shift certain values based on whether the week was specified to start on Monday or Sunday. Cut out a lot of edge case code compared to the previous version. Also broke algorithm out into its own function (that is private to the module). Fixes bug #1643943 (thanks Biran Nahas for the report).
Diffstat (limited to 'Lib/test/test_strptime.py')
-rw-r--r--Lib/test/test_strptime.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py
index ba65649..56e1ab8 100644
--- a/Lib/test/test_strptime.py
+++ b/Lib/test/test_strptime.py
@@ -463,6 +463,10 @@ class CalculationTests(unittest.TestCase):
"of the year")
test_helper((1917, 12, 31), "Dec 31 on Monday with year starting and "
"ending on Monday")
+ test_helper((2007, 01, 07), "First Sunday of 2007")
+ test_helper((2007, 01, 14), "Second Sunday of 2007")
+ test_helper((2006, 12, 31), "Last Sunday of 2006")
+ test_helper((2006, 12, 24), "Second to last Sunday of 2006")
class CacheTests(unittest.TestCase):