| LEFT | RIGHT |
| 1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
| 2 # Copyright (C) 2006-present eyeo GmbH | 2 # Copyright (C) 2006-present eyeo GmbH |
| 3 # | 3 # |
| 4 # Adblock Plus is free software: you can redistribute it and/or modify | 4 # Adblock Plus is free software: you can redistribute it and/or modify |
| 5 # it under the terms of the GNU General Public License version 3 as | 5 # it under the terms of the GNU General Public License version 3 as |
| 6 # published by the Free Software Foundation. | 6 # published by the Free Software Foundation. |
| 7 # | 7 # |
| 8 # Adblock Plus is distributed in the hope that it will be useful, | 8 # Adblock Plus is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 yield True | 61 yield True |
| 62 os.environ = old_env | 62 os.environ = old_env |
| 63 | 63 |
| 64 | 64 |
| 65 @pytest.mark.script_launch_mode('subprocess') | 65 @pytest.mark.script_launch_mode('subprocess') |
| 66 @pytest.mark.parametrize('args,exp_msg', [ | 66 @pytest.mark.parametrize('args,exp_msg', [ |
| 67 (['-h'], 'usage: xtm_translations.py [-h] [-v] ' | 67 (['-h'], 'usage: xtm_translations.py [-h] [-v] ' |
| 68 '{login,create,upload,download} ...'), | 68 '{login,create,upload,download} ...'), |
| 69 (['create', '-h'], 'usage: xtm_translations.py create [-h] --name NAME ' | 69 (['create', '-h'], 'usage: xtm_translations.py create [-h] --name NAME ' |
| 70 '--desc DESC --client-id CLIENT_ID --ref-id REF_ID ' | 70 '--desc DESC --client-id CLIENT_ID --ref-id REF_ID ' |
| 71 '--workflow-id WORKFLOW_ID [--source-lang ' | 71 '[--workflow-id WORKFLOW_ID] [--source-lang ' |
| 72 'SOURCE_LANG] [--save-id] [--workflow-name ' | 72 'SOURCE_LANG] [--save-id] [--workflow-name ' |
| 73 'WORKFLOW_NAME] [source_dir]'), | 73 'WORKFLOW_NAME] [source_dir]'), |
| 74 (['upload', '-h'], 'usage: xtm_translations.py upload [-h] ' | 74 (['upload', '-h'], 'usage: xtm_translations.py upload [-h] ' |
| 75 '[--no-overwrite] [source_dir]'), | 75 '[--no-overwrite] [source_dir]'), |
| 76 (['download', '-h'], 'usage: xtm_translations.py download [-h] ' | 76 (['download', '-h'], 'usage: xtm_translations.py download [-h] ' |
| 77 '[source_dir]'), | 77 '[source_dir]'), |
| 78 ]) | 78 ]) |
| 79 def test_usage_messages(args, exp_msg, script_runner): | 79 def test_usage_messages(args, exp_msg, script_runner): |
| 80 """Test if appropriate usage messages are displayed.""" | 80 """Test if appropriate usage messages are displayed.""" |
| 81 cmd = list(_CMD_START) | 81 cmd = list(_CMD_START) |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 main_project_handler(namespace) | 275 main_project_handler(namespace) |
| 276 | 276 |
| 277 with open(os.path.join(temp_site_valid_project, 'locales', 'de', | 277 with open(os.path.join(temp_site_valid_project, 'locales', 'de', |
| 278 'file.json')) as f: | 278 'file.json')) as f: |
| 279 assert json.dumps({'foo': 'bar', 'faz': 'baz'}) == f.read() | 279 assert json.dumps({'foo': 'bar', 'faz': 'baz'}) == f.read() |
| 280 | 280 |
| 281 with open(os.path.join(temp_site_valid_project, 'locales', 'de', 'foo', | 281 with open(os.path.join(temp_site_valid_project, 'locales', 'de', 'foo', |
| 282 'file-utf8.json'), 'rb') as f: | 282 'file-utf8.json'), 'rb') as f: |
| 283 assert json.loads(f.read()) == {'foo': '\u1234'} | 283 assert json.loads(f.read()) == {'foo': '\u1234'} |
| LEFT | RIGHT |