(self)
| 2993 | self.assertEqual(d, self.theclass(1969, 12, 31, 23, 59, 58, 950000)) |
| 2994 | |
| 2995 | def test_utcnow(self): |
| 2996 | import time |
| 2997 | |
| 2998 | # Call it a success if utcnow() and utcfromtimestamp() are within |
| 2999 | # a second of each other. |
| 3000 | tolerance = timedelta(seconds=1) |
| 3001 | for dummy in range(3): |
| 3002 | with self.assertWarns(DeprecationWarning): |
| 3003 | from_now = self.theclass.utcnow() |
| 3004 | |
| 3005 | with self.assertWarns(DeprecationWarning): |
| 3006 | from_timestamp = self.theclass.utcfromtimestamp(time.time()) |
| 3007 | if abs(from_timestamp - from_now) <= tolerance: |
| 3008 | break |
| 3009 | # Else try again a few times. |
| 3010 | self.assertLessEqual(abs(from_timestamp - from_now), tolerance) |
| 3011 | |
| 3012 | def test_strptime(self): |
| 3013 | string = '2004-12-01 13:02:47.197' |
nothing calls this directly
no test coverage detected