From 8ef344d9bfabee9bb92d1a87da1f238feef2a380 Mon Sep 17 00:00:00 2001 From: Morgan Wahl Date: Fri, 25 Feb 2022 19:08:12 -0500 Subject: Fix output of --list-locales to not be a bytes repr Co-authored-by: Aarni Koskela --- tests/messages/test_frontend.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/messages/test_frontend.py') diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py index f8a58dd..40afab7 100644 --- a/tests/messages/test_frontend.py +++ b/tests/messages/test_frontend.py @@ -756,6 +756,17 @@ usage: pybabel command [options] [args] pybabel: error: no valid command or option passed. try the -h/--help option for more information. """, sys.stderr.getvalue().lower()) + def test_list_locales(self): + """ + Test the command with the --list-locales arg. + """ + result = self.cli.run(sys.argv + ['--list-locales']) + assert not result + output = sys.stdout.getvalue() + assert 'fr_CH' in output + assert 'French (Switzerland)' in output + assert "\nb'" not in output # No bytes repr markers in output + def _run_init_catalog(self): i18n_dir = os.path.join(data_dir, 'project', 'i18n') pot_path = os.path.join(data_dir, 'project', 'i18n', 'messages.pot') -- cgit v1.2.1