我们从Python开源项目中,提取了以下11个代码示例,用于说明如何使用imaplib.Time2Internaldate()。
def test_that_Time2Internaldate_returns_a_result(self): # We can check only that it successfully produces a result, # not the correctness of the result itself, since the result # depends on the timezone the machine is in. timevalues = [2000000000, 2000000000.0, time.localtime(2000000000), '"18-May-2033 05:33:20 +0200"'] for t in timevalues: imaplib.Time2Internaldate(t)
def test_Time2Internaldate(self): expected = '"18-May-2033 05:33:20 +0200"' for t in self.timevalues(): internal = imaplib.Time2Internaldate(t) self.assertEqual(internal, expected)
def test_that_Time2Internaldate_returns_a_result(self): # Without tzset, we can check only that it successfully # produces a result, not the correctness of the result itself, # since the result depends on the timezone the machine is in. for t in self.timevalues(): imaplib.Time2Internaldate(t)