(self)
| 2259 | self.assertEqual(dt.microsecond, 8000) |
| 2260 | |
| 2261 | def test_roundtrip(self): |
| 2262 | for dt in (self.theclass(1, 2, 3, 4, 5, 6, 7), |
| 2263 | self.theclass.now()): |
| 2264 | # Verify dt -> string -> datetime identity. |
| 2265 | s = repr(dt) |
| 2266 | self.assertStartsWith(s, 'datetime.') |
| 2267 | s = s[9:] |
| 2268 | dt2 = eval(s) |
| 2269 | self.assertEqual(dt, dt2) |
| 2270 | |
| 2271 | # Verify identity via reconstructing from pieces. |
| 2272 | dt2 = self.theclass(dt.year, dt.month, dt.day, |
| 2273 | dt.hour, dt.minute, dt.second, |
| 2274 | dt.microsecond) |
| 2275 | self.assertEqual(dt, dt2) |
| 2276 | |
| 2277 | def test_isoformat(self): |
| 2278 | t = self.theclass(1, 2, 3, 4, 5, 1, 123) |
nothing calls this directly
no test coverage detected