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

Function test_gettz_absolute_path

tests/test_tzfile.py:2332–2342  ·  view source on GitHub ↗

An absolute path to a TZif file is loaded directly and has no key.

(zoneinfo_cache)

Source from the content-addressed store, hash-verified

2330
2331@pytest.mark.parametrize("zoneinfo_cache", ["fat"], indirect=True)
2332def test_gettz_absolute_path(zoneinfo_cache):
2333 """An absolute path to a TZif file is loaded directly and has no key."""
2334 fpath = os.path.join(zoneinfo_cache[0], "America", "New_York")
2335
2336 with set_tzpath((), block_tzdata=True):
2337 tz.gettz.cache_clear()
2338 zone = tz.gettz(fpath)
2339
2340 assert isinstance(zone, tz.tzfile)
2341 assert zone.key is None
2342 assert repr(zone) == "tzfile(%r)" % fpath
2343
2344
2345@pytest.mark.parametrize("zoneinfo_cache", ["fat"], indirect=True)

Callers

nothing calls this directly

Calls 3

set_tzpathFunction · 0.85
cache_clearMethod · 0.80
gettzMethod · 0.45

Tested by

no test coverage detected