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

Method test_tzlocal_parse_fold

tests/test_parser.py:914–927  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

912 assert dt == dt_exp
913
914 def test_tzlocal_parse_fold(self):
915 # One manifestion of GH #318
916 with TZEnvContext('EST+5EDT,M3.2.0/2,M11.1.0/2'):
917 dt_exp = datetime(2011, 11, 6, 1, 30, tzinfo=tz.tzlocal())
918 dt_exp = tz.enfold(dt_exp, fold=1)
919 dt = parse('2011-11-06T01:30 EST')
920
921 # Because this is ambiguous, until `tz.tzlocal() is tz.tzlocal()`
922 # we'll just check the attributes we care about rather than
923 # dt == dt_exp
924 assert dt.tzname() == dt_exp.tzname()
925 assert dt.replace(tzinfo=None) == dt_exp.replace(tzinfo=None)
926 assert getattr(dt, 'fold') == getattr(dt_exp, 'fold')
927 assert dt.astimezone(tz.UTC) == dt_exp.astimezone(tz.UTC)
928
929
930def test_parse_tzinfos_fold():

Callers

nothing calls this directly

Calls 4

parseFunction · 0.90
TZEnvContextClass · 0.85
replaceMethod · 0.80
tznameMethod · 0.45

Tested by

no test coverage detected