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

Side by Side Diff: tests/conftest.py

Issue 29912588: Issue 7019 - [CMS] Refactor `test_server.py` (Closed)
Patch Set: Updated exception tests. Removed duplicates from ignores Created Oct. 18, 2018, 4:09 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
OLDNEW
1 from __future__ import unicode_literals 1 from __future__ import unicode_literals
2 2
3 import os 3 import os
4 import pytest 4 import pytest
5 import shutil 5 import shutil
6 6
7 pytest_plugins = [ 7 pytest_plugins = [
8 'tests.xtm_conftest', 8 'tests.xtm_conftest',
9 ] 9 ]
10 10
11 _INTERCEPT_PORT = 443 11 _INTERCEPT_PORT = 443
12 _INTERCEPT_HOST = 'wstest2.xtm-intl.com' 12 _INTERCEPT_HOST = 'wstest2.xtm-intl.com'
13 13
14 ROOTPATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 14 ROOTPATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
15 15
16 16
17 @pytest.fixture(scope='session') 17 @pytest.fixture(scope='session')
18 def temp_site(tmpdir_factory): 18 def temp_site(tmpdir_factory):
19 out_dir = tmpdir_factory.mktemp('temp_out') 19 out_dir = tmpdir_factory.mktemp('temp_out')
20 site_dir = out_dir.join('test_site').strpath 20 site_dir = out_dir.join('test_site').strpath
21 21
22 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir) 22 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
23 yield site_dir 23 yield site_dir
24
25
26 @pytest.fixture(scope='session')
27 def temp_site_with_conflicts(tmpdir_factory):
28 out_dir = tmpdir_factory.mktemp('temp_out_conflicts')
29 site_dir = out_dir.join('test_site').strpath
30
31 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
32 with open(os.path.join(site_dir, 'locales', 'en', 'translate'), 'w') \
Vasily Kuznetsov 2018/10/22 14:36:47 Nit: maybe construct the path in a separate line t
Tudor Avram 2018/10/23 16:44:34 Done.
33 as f:
34 f.write('Page with conflicts')
35
36 yield site_dir
OLDNEW

Powered by Google App Engine
This is Rietveld