diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2016-08-08 21:05:40 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2016-08-08 21:05:40 (GMT) |
commit | 47649ab1f105760ba9f4d60d540b6ea63f45795a (patch) | |
tree | 52339c890933052f8ba0d5ae1362d3ba4e496b7c /Lib/test/datetimetester.py | |
parent | 95e0df8389c8a44c0f6c6b6be8363e602e8e8914 (diff) | |
download | cpython-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.py | 5 |
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) |