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

Function test_parse_tzinfos_fold

tests/test_parser.py:930–941  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

928
929
930def test_parse_tzinfos_fold():
931 NYC = tz.gettz('America/New_York')
932 assert NYC is not None
933 tzinfos = {'EST': NYC, 'EDT': NYC}
934
935 dt_exp = tz.enfold(datetime(2011, 11, 6, 1, 30, tzinfo=NYC), fold=1)
936 dt = parse('2011-11-06T01:30 EST', tzinfos=tzinfos)
937
938 assert dt == dt_exp
939 assert dt.tzinfo is dt_exp.tzinfo
940 assert getattr(dt, 'fold') == getattr(dt_exp, 'fold')
941 assert dt.astimezone(tz.UTC) == dt_exp.astimezone(tz.UTC)
942
943
944@pytest.mark.parametrize('dtstr,dt', [

Callers

nothing calls this directly

Calls 2

parseFunction · 0.90
gettzMethod · 0.45

Tested by

no test coverage detected