MCPcopy Index your code
hub / github.com/python/cpython / test_available_timezones

Method test_available_timezones

Lib/test/test_zoneinfo/test_zoneinfo.py:1985–1995  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1983 self.assertCountEqual(module_dir, module_unique)
1984
1985 def test_available_timezones(self):
1986 with self.tzpath_context([self.zoneinfo_data.tzpath]):
1987 self.assertTrue(self.zoneinfo_data.keys) # Sanity check
1988
1989 available_keys = self.module.available_timezones()
1990 zoneinfo_keys = set(self.zoneinfo_data.keys)
1991
1992 # If tzdata is not present, zoneinfo_keys == available_keys,
1993 # otherwise it should be a subset.
1994 union = zoneinfo_keys & available_keys
1995 self.assertEqual(zoneinfo_keys, union)
1996
1997 def test_available_timezones_weirdzone(self):
1998 with tempfile.TemporaryDirectory() as td:

Callers

nothing calls this directly

Calls 4

setFunction · 0.85
tzpath_contextMethod · 0.80
assertTrueMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected