summaryrefslogtreecommitdiffstats
path: root/Lib/test/datetimetester.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2016-08-08 21:05:40 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2016-08-08 21:05:40 (GMT)
commit47649ab1f105760ba9f4d60d540b6ea63f45795a (patch)
tree52339c890933052f8ba0d5ae1362d3ba4e496b7c /Lib/test/datetimetester.py
parent95e0df8389c8a44c0f6c6b6be8363e602e8e8914 (diff)
downloadcpython-47649ab1f105760ba9f4d60d540b6ea63f45795a.zip
cpython-47649ab1f105760ba9f4d60d540b6ea63f45795a.tar.gz
cpython-47649ab1f105760ba9f4d60d540b6ea63f45795a.tar.bz2
Closes #27710: Disallow fold not in [0, 1] in time and datetime constructors.
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r--Lib/test/datetimetester.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index e71f3aa..726b7fd 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -1724,6 +1724,11 @@ class TestDateTime(TestDate):
self.assertRaises(ValueError, self.theclass,
2000, 1, 31, 23, 59, 59,
1000000)
+ # bad fold
+ self.assertRaises(ValueError, self.theclass,
+ 2000, 1, 31, fold=-1)
+ self.assertRaises(ValueError, self.theclass,
+ 2000, 1, 31, fold=2)
# Positional fold:
self.assertRaises(TypeError, self.theclass,
2000, 1, 31, 23, 59, 59, 0, None, 1)