diff options
author | Aarni Koskela <akx@iki.fi> | 2021-04-28 11:47:42 +0300 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2021-04-28 11:47:42 +0300 |
commit | 5caf717ceca4bd235552362b4fbff88983c75d8c (patch) | |
tree | 95156f9c47d60322f834e2100eff444be9319ff5 /tests | |
parent | 3a700b5b8b53606fd98ef8294a56f9510f7290f8 (diff) | |
download | babel-5caf717ceca4bd235552362b4fbff88983c75d8c.tar.gz |
Disallow special filenames on Windowslocale-basename
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_localedata.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_localedata.py b/tests/test_localedata.py index 9cb4282..c852c1b 100644 --- a/tests/test_localedata.py +++ b/tests/test_localedata.py @@ -159,3 +159,12 @@ def test_locale_name_cleanup(): localedata.load(name) with pytest.raises(UnknownLocaleError): Locale(name) + + +@pytest.mark.skipif(sys.platform != "win32", reason="windows-only test") +def test_reserved_locale_names(): + for name in ("con", "aux", "nul", "prn", "com8", "lpt5"): + with pytest.raises(ValueError): + localedata.load(name) + with pytest.raises(ValueError): + Locale(name) |