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

Side by Side Diff: tests/test_additional_paths.py

Issue 29756692: Noissue - Adapt best practices for trailing commas (cms) (Closed)
Patch Set: More cleanup, added flake8-commas extension Created April 19, 2018, 2:19 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 | « runserver.spec ('k') | tox.ini » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 @pytest.fixture(scope='session') 48 @pytest.fixture(scope='session')
49 def ap_site(temp_site, tmpdir_factory): 49 def ap_site(temp_site, tmpdir_factory):
50 """A website source that has another website in additional-paths.""" 50 """A website source that has another website in additional-paths."""
51 base_root = py.path.local(temp_site) 51 base_root = py.path.local(temp_site)
52 base_pages = base_root.join('pages') 52 base_pages = base_root.join('pages')
53 53
54 ap_root = tmpdir_factory.mktemp('ap_site') 54 ap_root = tmpdir_factory.mktemp('ap_site')
55 ap_root.join('settings.ini').write( 55 ap_root.join('settings.ini').write(
56 base_root.join('settings.ini').read() + 56 base_root.join('settings.ini').read() +
57 PATHS_FRAGMENT_TEMPLATE.format(base_root) 57 PATHS_FRAGMENT_TEMPLATE.format(base_root),
58 ) 58 )
59 59
60 pages = ap_root.mkdir('pages') 60 pages = ap_root.mkdir('pages')
61 for file_name in ['filter.tmpl', 'global.md', 'translate.tmpl']: 61 for file_name in ['filter.tmpl', 'global.md', 'translate.tmpl']:
62 pages.join(file_name).write('MAIN_SITE') 62 pages.join(file_name).write('MAIN_SITE')
63 pages.join('map.tmpl').write(base_pages.join('sitemap.tmpl').read()) 63 pages.join('map.tmpl').write(base_pages.join('sitemap.tmpl').read())
64 64
65 subprocess.check_call(['hg', 'init', ap_root.strpath]) 65 subprocess.check_call(['hg', 'init', ap_root.strpath])
66 subprocess.check_call(['hg', '-R', ap_root.strpath, 66 subprocess.check_call(['hg', '-R', ap_root.strpath,
67 'commit', '-A', '-m', 'foo']) 67 'commit', '-A', '-m', 'foo'])
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 three.join('three').write('') 115 three.join('three').write('')
116 three.join('settings.ini').write('') 116 three.join('settings.ini').write('')
117 117
118 four.join('four').write('') 118 four.join('four').write('')
119 four.join('settings.ini').write('[paths]') 119 four.join('settings.ini').write('[paths]')
120 120
121 source = create_source(one.strpath) 121 source = create_source(one.strpath)
122 122
123 for name in ['one', 'two', 'three', 'four']: 123 for name in ['one', 'two', 'three', 'four']:
124 assert source.has_file(name) 124 assert source.has_file(name)
OLDNEW
« no previous file with comments | « runserver.spec ('k') | tox.ini » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld