From 2572ce0554c70f6bfe3c0d7d01afd8de82d1d94f Mon Sep 17 00:00:00 2001 From: Sean Breckenridge Date: Thu, 26 Oct 2023 15:39:29 -0700 Subject: [PATCH] nicer error message for mismatched locales --- README.md | 2 +- tests/test_types.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 00d376b..7e22163 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Options: -h, --help Show this message and exit. ``` -If you use a language this doesn't support, you can [create an issue](https://github.com/seanbreckenridge/google_takeout_parser/issues/new?title=support+new+locale) with the file structure (run `find Takeout` and/or `tree Takeout`) +If you use a language this doesn't support, see [contributing](#contributing). To clear the `cachew` cache: `google_takeout_parser cache_dir clear` diff --git a/tests/test_types.py b/tests/test_types.py index 5831dec..44787bd 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -58,5 +58,7 @@ def test_locale_names() -> None: from google_takeout_parser.locales.main import LOCALES from google_takeout_parser.locales.all import LOCALES as ALL_LOCALES - assert len(LOCALES) == len(ALL_LOCALES) - assert set(LOCALES.keys()) == set(ALL_LOCALES) + errmsg = "LOCALES in all.py/main.py must be the same length and have the same keys, you probably added a locale to one of these and not the other" + + assert len(LOCALES) == len(ALL_LOCALES), errmsg + assert set(LOCALES.keys()) == set(ALL_LOCALES), errmsg