Spaces in a key are tried as underscores, whichever source is used.
(source, zoneinfo_cache)
| 2293 | @pytest.mark.parametrize("zoneinfo_cache", ["fat"], indirect=True) |
| 2294 | @pytest.mark.parametrize("source", ["tzdata", "tzpath"]) |
| 2295 | def test_gettz_space_for_underscore(source, zoneinfo_cache): |
| 2296 | """Spaces in a key are tried as underscores, whichever source is used.""" |
| 2297 | if source == "tzdata": |
| 2298 | pytest.importorskip("tzdata") |
| 2299 | paths = () |
| 2300 | else: |
| 2301 | paths = (zoneinfo_cache[0],) |
| 2302 | |
| 2303 | with set_tzpath(paths, block_tzdata=(source != "tzdata")): |
| 2304 | tz.gettz.cache_clear() |
| 2305 | with_space = tz.gettz("America/New York") |
| 2306 | assert with_space is not None |
| 2307 | assert with_space.key == "America/New York" |
| 2308 | assert with_space == tz.gettz("America/New_York") |
| 2309 | |
| 2310 | |
| 2311 | #### |
nothing calls this directly
no test coverage detected