Martin v. Löwis | ea752fb | 2002-01-05 11:31:49 +0000 | [diff] [blame] | 1 | import imaplib |
Tim Peters | 108b791 | 2002-07-31 16:42:33 +0000 | [diff] [blame] | 2 | import time |
Martin v. Löwis | ea752fb | 2002-01-05 11:31:49 +0000 | [diff] [blame] | 3 | |
Jerry Seutter | 14f0bc7 | 2008-03-26 05:03:03 +0000 | [diff] [blame] | 4 | from test import test_support |
| 5 | import unittest |
Piers Lauder | f0a70f6 | 2002-06-17 07:06:24 +0000 | [diff] [blame] | 6 | |
Martin v. Löwis | ea752fb | 2002-01-05 11:31:49 +0000 | [diff] [blame] | 7 | |
Jerry Seutter | 14f0bc7 | 2008-03-26 05:03:03 +0000 | [diff] [blame] | 8 | class TestImaplib(unittest.TestCase): |
| 9 | def test_that_Time2Internaldate_returns_a_result(self): |
| 10 | # We can check only that it successfully produces a result, |
| 11 | # not the correctness of the result itself, since the result |
| 12 | # depends on the timezone the machine is in. |
| 13 | timevalues = [2000000000, 2000000000.0, time.localtime(2000000000), |
| 14 | '"18-May-2033 05:33:20 +0200"'] |
| 15 | |
| 16 | for t in timevalues: |
| 17 | imaplib.Time2Internaldate(t) |
| 18 | |
| 19 | |
| 20 | def test_main(): |
| 21 | test_support.run_unittest(TestImaplib) |
| 22 | |
| 23 | |
| 24 | if __name__ == "__main__": |
| 25 | unittest.main() |