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

Method test_folder_exclusions

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

Source from the content-addressed store, hash-verified

2004 self.assertIn("Mars/Olympus_Mons", available_keys)
2005
2006 def test_folder_exclusions(self):
2007 expected = {
2008 "America/Los_Angeles",
2009 "America/Santiago",
2010 "America/Indiana/Indianapolis",
2011 "UTC",
2012 "Europe/Paris",
2013 "Europe/London",
2014 "Asia/Tokyo",
2015 "Australia/Sydney",
2016 }
2017
2018 base_tree = list(expected)
2019 posix_tree = [f"posix/{x}" for x in base_tree]
2020 right_tree = [f"right/{x}" for x in base_tree]
2021
2022 cases = [
2023 ("base_tree", base_tree),
2024 ("base_and_posix", base_tree + posix_tree),
2025 ("base_and_right", base_tree + right_tree),
2026 ("all_trees", base_tree + right_tree + posix_tree),
2027 ]
2028
2029 with tempfile.TemporaryDirectory() as td:
2030 for case_name, tree in cases:
2031 tz_root = os.path.join(td, case_name)
2032 os.mkdir(tz_root)
2033
2034 for key in tree:
2035 self.touch_zone(key, tz_root)
2036
2037 with self.tzpath_context([tz_root]):
2038 with self.subTest(case_name):
2039 actual = self.module.available_timezones()
2040 self.assertEqual(actual, expected)
2041
2042 def test_exclude_posixrules(self):
2043 expected = {

Callers

nothing calls this directly

Calls 7

touch_zoneMethod · 0.95
listClass · 0.85
tzpath_contextMethod · 0.80
joinMethod · 0.45
mkdirMethod · 0.45
subTestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected