MCPcopy Create free account
hub / github.com/dateutil/dateutil / testFileLastTransition

Method testFileLastTransition

tests/test_tz.py:2108–2118  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2106 self.assertEqual(end_est.tzname(), "EST")
2107
2108 def testFileLastTransition(self):
2109 # After the last transition, it goes to standard time in perpetuity
2110 tzc = tz.tzfile(BytesIO(base64.b64decode(TZFILE_EST5EDT)))
2111 self.assertEqual(datetime(2037, 10, 25, 0, 59, tzinfo=tzc).tzname(),
2112 "EDT")
2113
2114 last_date = tz.enfold(datetime(2037, 10, 25, 1, 0, tzinfo=tzc), fold=1)
2115 self.assertEqual(last_date.tzname(), "EST")
2116
2117 self.assertEqual(datetime(2038, 5, 25, 12, 0, tzinfo=tzc).tzname(),
2118 "EST")
2119
2120 def testInvalidFile(self):
2121 # Should throw a ValueError if an invalid file is passed

Callers

nothing calls this directly

Calls 1

tznameMethod · 0.45

Tested by

no test coverage detected