Closes #27710: Disallow fold not in [0, 1] in time and datetime constructors.

This commit is contained in:
Alexander Belopolsky 2016-08-08 17:05:40 -04:00
parent 95e0df8389
commit 47649ab1f1
3 changed files with 36 additions and 11 deletions

View file

@ -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)