Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: tests/xtm_conftest.py

Issue 29968558: Issue 7037 - [XTM Integration] Make REST API url customizable
Patch Set: Removed one more print statement Created Sept. 17, 2019, 12:36 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/utils.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 from __future__ import unicode_literals 1 from __future__ import unicode_literals
2 2
3 import os 3 import os
4 import shutil 4 import shutil
5 import json 5 import json
6 6
7 import pytest 7 import pytest
8 from cms.sources import FileSource 8 from cms.sources import FileSource
9 from wsgi_intercept import add_wsgi_intercept 9 from wsgi_intercept import add_wsgi_intercept
10 from wsgi_intercept import remove_wsgi_intercept 10 from wsgi_intercept import remove_wsgi_intercept
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 def temp_site_function_scope(tmpdir): 69 def temp_site_function_scope(tmpdir):
70 out_dir = tmpdir.mkdir('temp_site_func') 70 out_dir = tmpdir.mkdir('temp_site_func')
71 site_dir = out_dir.join('test_site').strpath 71 site_dir = out_dir.join('test_site').strpath
72 72
73 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir) 73 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
74 74
75 return site_dir 75 return site_dir
76 76
77 77
78 @pytest.fixture 78 @pytest.fixture
79 def temp_site_url_in_config(tmpdir):
80 out_dir = tmpdir.mkdir('temp_site_url')
81 site_dir = out_dir.join('test_site').strpath
82
83 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
84
85 with FileSource(str(site_dir)) as fs:
86 fs.write_to_config('XTM', 'url', 'www.bar.com')
87
88 return site_dir
89
90
91 @pytest.fixture
92 def temp_site_no_project(tmpdir):
93 out_dir = tmpdir.mkdir('temp_site_url')
94 site_dir = out_dir.join('test_site').strpath
95
96 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
97
98 return site_dir
99
100
101 @pytest.fixture
79 def intercept(): 102 def intercept():
80 app = get_configured_app() 103 app = get_configured_app()
81 requests_intercept.install() 104 requests_intercept.install()
82 add_wsgi_intercept(_INTERCEPT_HOST, _INTERCEPT_PORT, lambda: app) 105 add_wsgi_intercept(_INTERCEPT_HOST, _INTERCEPT_PORT, lambda: app)
83 yield app 106 yield app
84 remove_wsgi_intercept() 107 remove_wsgi_intercept()
85 108
86 109
87 @pytest.fixture 110 @pytest.fixture
88 def intercept_populated(): 111 def intercept_populated():
(...skipping 16 matching lines...) Expand all
105 128
106 129
107 @pytest.fixture 130 @pytest.fixture
108 def intercept_too_many_targets(): 131 def intercept_too_many_targets():
109 targets = ['de_DE', 'es_ES'] 132 targets = ['de_DE', 'es_ES']
110 app = get_configured_app(target_langs=targets) 133 app = get_configured_app(target_langs=targets)
111 requests_intercept.install() 134 requests_intercept.install()
112 add_wsgi_intercept(_INTERCEPT_HOST, _INTERCEPT_PORT, lambda: app) 135 add_wsgi_intercept(_INTERCEPT_HOST, _INTERCEPT_PORT, lambda: app)
113 yield app 136 yield app
114 remove_wsgi_intercept() 137 remove_wsgi_intercept()
OLDNEW
« no previous file with comments | « tests/utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld