This function only includes canonical zone names and does not include
"special" zones such as those under the ``posix/`` and ``right/``
- directories, or the ``posixrules`` zone.
+ directories, the ``posixrules`` or the ``localtime`` zone.
.. caution::
actual = self.module.available_timezones()
self.assertEqual(actual, expected)
+ def test_exclude_localtime(self):
+ expected = {
+ "America/New_York",
+ "Europe/London",
+ }
+
+ tree = list(expected) + ["localtime"]
+
+ with tempfile.TemporaryDirectory() as td:
+ for key in tree:
+ self.touch_zone(key, td)
+
+ with self.tzpath_context([td]):
+ actual = self.module.available_timezones()
+ self.assertEqual(actual, expected)
class CTestModule(TestModule):
module = c_zoneinfo
# posixrules is a special symlink-only time zone where it exists, it
# should not be included in the output
valid_zones.remove("posixrules")
+ if "localtime" in valid_zones:
+ # localtime is a special symlink-only time zone where it exists, it
+ # should not be included in the output
+ valid_zones.remove("localtime")
return valid_zones
--- /dev/null
+Removed ``localtime`` from the list of reported system timezones.