(self)
| 355 | with self.assertRaises(TypeError): self.EST.tzname(5) |
| 356 | |
| 357 | def test_fromutc(self): |
| 358 | with self.assertRaises(ValueError): |
| 359 | timezone.utc.fromutc(self.DT) |
| 360 | with self.assertRaises(TypeError): |
| 361 | timezone.utc.fromutc('not datetime') |
| 362 | for tz in [self.EST, self.ACDT, Eastern]: |
| 363 | utctime = self.DT.replace(tzinfo=tz) |
| 364 | local = tz.fromutc(utctime) |
| 365 | self.assertEqual(local - utctime, tz.utcoffset(local)) |
| 366 | self.assertEqual(local, |
| 367 | self.DT.replace(tzinfo=timezone.utc)) |
| 368 | |
| 369 | def test_comparison(self): |
| 370 | self.assertNotEqual(timezone(ZERO), timezone(HOUR)) |
nothing calls this directly
no test coverage detected