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

Method testIsStd

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

Source from the content-addressed store, hash-verified

2044 self.assertEqual(len(remaining_tzfile_content), 0)
2045
2046 def testIsStd(self):
2047 # NEW_YORK tzfile contains this isstd information:
2048 isstd_expected = (0, 0, 0, 1)
2049 tzc = tz.tzfile(BytesIO(base64.b64decode(NEW_YORK)))
2050 # gather the actual information as parsed by the tzfile class
2051 isstd = []
2052 for ttinfo in tzc._ttinfo_list:
2053 # ttinfo objects contain boolean values
2054 isstd.append(int(ttinfo.isstd))
2055 # ttinfo list may contain more entries than isstd file content
2056 isstd = tuple(isstd[:len(isstd_expected)])
2057 self.assertEqual(
2058 isstd_expected, isstd,
2059 "isstd UTC/local indicators parsed: %s != tzfile contents: %s"
2060 % (isstd, isstd_expected))
2061
2062 def testGMTHasNoDaylight(self):
2063 # tz.tzstr("GMT+2") improperly considered daylight saving time.

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected