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 |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 from flask import Flask, request, jsonify, Response, send_file | 16 from flask import Flask, request, jsonify, Response, send_file |
17 | 17 |
18 import json | 18 import json |
19 | 19 |
20 from tests.utils import create_in_memory_zip | 20 from tests.utils import create_in_memory_zip |
21 from cms.bin.xtm_translations.constants import SUPPORTED_LOCALES | 21 from cms.translations.xtm.constants import SUPPORTED_LOCALES |
22 | 22 |
23 __all__ = [ | 23 __all__ = [ |
24 'xtm_mock', | 24 'xtm_mock', |
25 'get_configured_app', | 25 'get_configured_app', |
26 ] | 26 ] |
27 | 27 |
28 _CREDENTIALS = { | 28 _CREDENTIALS = { |
29 'token_gen_valid': {'client': 'admin', 'password': 'pass', 'userId': 20}, | 29 'token_gen_valid': {'client': 'admin', 'password': 'pass', 'userId': 20}, |
30 'token_gen_invalid': {'client': 'user', 'password': 'pass', 'userId': 50}, | 30 'token_gen_invalid': {'client': 'user', 'password': 'pass', 'userId': 50}, |
31 'token_valid': 'TheXTM-APIToken-VALID', | 31 'token_valid': 'TheXTM-APIToken-VALID', |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 zip_file = create_in_memory_zip(names, data) | 265 zip_file = create_in_memory_zip(names, data) |
266 return send_file( | 266 return send_file( |
267 zip_file, | 267 zip_file, |
268 mimetype='application/zip', | 268 mimetype='application/zip', |
269 ) | 269 ) |
270 | 270 |
271 | 271 |
272 if __name__ == '__main__': | 272 if __name__ == '__main__': |
273 xtm_mock.run(debug=True) | 273 xtm_mock.run(debug=True) |
LEFT | RIGHT |