We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a84d66c commit df899eaCopy full SHA for df899ea
Lib/test/test_email/test_parsedate_to_datetime.py
@@ -0,0 +1,17 @@
1
+# Test to see if parsedate_to_datetime returns the correct year for different digit numbers, adhering to the RFC2822 spec
2
+
3
+import unittest
4
+from email.utils import parsedate_to_datetime
5
6
+class ParsedateToDatetimeTest(unittest.TestCase):
7
+ def test(self):
8
+ expectations = {
9
+ "Sat, 15 Aug 0001 23:12:09 +0500": "0001",
10
+ "Thu, 1 Sep 1 23:12:09 +0800": "0001",
11
+ "Thu, 7 Oct 123 23:12:09 +0500": "0123",
12
+ }
13
+ for input_string, output_string in expectations.items():
14
+ self.assertEqual(str(parsedate_to_datetime(input_string))[:4], output_string)
15
16
+if __name__ == '__main__':
17
+ unittest.main()
0 commit comments