OLD | NEW |
1 import os | 1 import os |
2 import shutil | 2 import shutil |
3 import pytest | 3 import pytest |
4 from wsgi_intercept import urllib3_intercept | 4 from wsgi_intercept import urllib3_intercept |
5 from wsgi_intercept import add_wsgi_intercept | 5 from wsgi_intercept import add_wsgi_intercept |
6 from wsgi_intercept import remove_wsgi_intercept | 6 from wsgi_intercept import remove_wsgi_intercept |
7 | 7 |
8 from crowdin_mock_api import app | 8 from crowdin_mock_api import app |
9 from cms.bin import translate | 9 from cms.bin import translate |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 host = 'api.crowdin.com' | 39 host = 'api.crowdin.com' |
40 port = 443 | 40 port = 443 |
41 urllib3_intercept.install() | 41 urllib3_intercept.install() |
42 add_wsgi_intercept(host, port, lambda: app.wsgi_app) | 42 add_wsgi_intercept(host, port, lambda: app.wsgi_app) |
43 yield None | 43 yield None |
44 remove_wsgi_intercept() | 44 remove_wsgi_intercept() |
45 | 45 |
46 | 46 |
47 def test_sync(temp_site, make_intercept, make_crowdin_zip, expect_requests): | 47 def test_sync(temp_site, make_intercept, make_crowdin_zip, expect_requests): |
48 translate.crowdin_sync(temp_site, 'test_key') | 48 translate.crowdin_sync(temp_site, 'test_key') |
49 for (url, data), (expect_url, expect_data) in zip( | 49 for (url, data), (expect_url, expect_data) in zip(app.request_log, |
50 app.request_log, | |
51 expect_requests): | 50 expect_requests): |
52 assert expect_url in url | 51 assert expect_url in url |
53 assert expect_data in data | 52 assert expect_data in data |
OLD | NEW |