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