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

Side by Side Diff: cms-dev/tests/test_cms_cmp.py

Issue 29756682: Noissue - Adapt best practices for trailing commas (codingtools) (Closed)
Patch Set: Added flake8-commas extension Created April 19, 2018, 2:50 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 | « no previous file | cms-dev/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 Adblock Plus <https://adblockplus.org/>, 1 # This file is part of Adblock Plus <https://adblockplus.org/>,
2 # Copyright (C) 2017-present eyeo GmbH 2 # Copyright (C) 2017-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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 hg('commit', '-A', '-m', 'x', repo=str(root)) 45 hg('commit', '-A', '-m', 'x', repo=str(root))
46 return root 46 return root
47 47
48 48
49 @pytest.fixture(scope='session') 49 @pytest.fixture(scope='session')
50 def cms(tmpdir_factory): 50 def cms(tmpdir_factory):
51 root = tmpdir_factory.mktemp('cms') 51 root = tmpdir_factory.mktemp('cms')
52 generate = root.mkdir('cms').mkdir('bin').join('generate_static_pages.py') 52 generate = root.mkdir('cms').mkdir('bin').join('generate_static_pages.py')
53 generate.write('\n'.join([ 53 generate.write('\n'.join([
54 'import sys, shutil', 54 'import sys, shutil',
55 'shutil.copytree(sys.argv[1], sys.argv[2])' 55 'shutil.copytree(sys.argv[1], sys.argv[2])',
56 ])) 56 ]))
57 hg('init', str(root)) 57 hg('init', str(root))
58 hg('commit', '-A', '-m', 'x', repo=str(root)) 58 hg('commit', '-A', '-m', 'x', repo=str(root))
59 root.join('foo').write('bar') 59 root.join('foo').write('bar')
60 hg('commit', '-A', '-m', 'y', repo=str(root)) 60 hg('commit', '-A', '-m', 'y', repo=str(root))
61 generate.write( 61 generate.write(
62 generate.read() + 62 generate.read() +
63 '\nshutil.copy(sys.argv[2] + "/foo", sys.argv[2] + "/bar")' 63 '\nshutil.copy(sys.argv[2] + "/foo", sys.argv[2] + "/bar")',
64 ) 64 )
65 hg('commit', '-m', 'z', repo=str(root)) 65 hg('commit', '-m', 'z', repo=str(root))
66 hg('bookmark', '-r', '0', 'master', repo=str(root)) 66 hg('bookmark', '-r', '0', 'master', repo=str(root))
67 hg('bookmark', '-r', '1', 'yoda', repo=str(root)) 67 hg('bookmark', '-r', '1', 'yoda', repo=str(root))
68 hg('bookmark', '-r', '2', 'other', repo=str(root)) 68 hg('bookmark', '-r', '2', 'other', repo=str(root))
69 return root 69 return root
70 70
71 71
72 def test_same_revision(website, cms, tmpdir): 72 def test_same_revision(website, cms, tmpdir):
73 run_cms_cmp('-d', str(tmpdir), '-c', str(cms), 73 run_cms_cmp('-d', str(tmpdir), '-c', str(cms),
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 def test_working_copy(website, cms, tmpdir): 119 def test_working_copy(website, cms, tmpdir):
120 with pytest.raises(subprocess.CalledProcessError): 120 with pytest.raises(subprocess.CalledProcessError):
121 # This will fail because current version is 'other'. 121 # This will fail because current version is 'other'.
122 run_cms_cmp('-d', str(tmpdir), '-c', str(cms), str(website)) 122 run_cms_cmp('-d', str(tmpdir), '-c', str(cms), str(website))
123 generate = cms.join('cms').join('bin').join('generate_static_pages.py') 123 generate = cms.join('cms').join('bin').join('generate_static_pages.py')
124 # Remove last line that breaks stuff. 124 # Remove last line that breaks stuff.
125 generate.write('\n'.join(generate.read().splitlines()[:-1])) 125 generate.write('\n'.join(generate.read().splitlines()[:-1]))
126 # Now it should be better. 126 # Now it should be better.
127 run_cms_cmp('-d', str(tmpdir), '-c', str(cms), str(website)) 127 run_cms_cmp('-d', str(tmpdir), '-c', str(cms), str(website))
OLDNEW
« no previous file with comments | « no previous file | cms-dev/tox.ini » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld