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

Side by Side Diff: tests/test_render_script.py

Issue 29851654: Issue 6850 - Remove generation of checksums (Closed) Base URL: https://hg.adblockplus.org/python-abp/
Patch Set: Add test for checksum removal, fix README references Created Aug. 10, 2018, 10:28 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 | « abp/filters/renderer.py ('k') | tests/test_renderer.py » ('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) 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 test_input = eval(test_input) 114 test_input = eval(test_input)
115 args = list(map(eval, args)) 115 args = list(map(eval, args))
116 _, _, stdout = run_script(*args, cwd=str(rootdir), test_in=test_input) 116 _, _, stdout = run_script(*args, cwd=str(rootdir), test_in=test_input)
117 117
118 if len(args) > 1: 118 if len(args) > 1:
119 output = dstfile.read() 119 output = dstfile.read()
120 else: 120 else:
121 output = stdout 121 output = stdout
122 122
123 assert 'Ok' in output 123 assert 'Ok' in output
124 assert '! Checksum:' in output
125 124
126 125
127 def test_render_unicode(rootdir, dstfile): 126 def test_render_unicode(rootdir, dstfile):
128 code, err, _ = run_script(str(rootdir.join('unicode.txt')), str(dstfile)) 127 code, err, _ = run_script(str(rootdir.join('unicode.txt')), str(dstfile))
129 assert '\u1234' in dstfile.read(mode='rb').decode('utf-8') 128 assert '\u1234' in dstfile.read(mode='rb').decode('utf-8')
130 129
131 130
132 def test_render_with_includes(rootdir, dstfile): 131 def test_render_with_includes(rootdir, dstfile):
133 run_script(str(rootdir.join('includer.txt')), str(dstfile), 132 run_script(str(rootdir.join('includer.txt')), str(dstfile),
134 '-i', 'inc=' + str(rootdir.join('inc'))) 133 '-i', 'inc=' + str(rootdir.join('inc')))
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 202
204 @pytest.mark.slowtest 203 @pytest.mark.slowtest
205 def test_failed_web_include(rootdir, dstfile, webserver_port): 204 def test_failed_web_include(rootdir, dstfile, webserver_port):
206 url = 'http://localhost:{}/missing.txt'.format(webserver_port) 205 url = 'http://localhost:{}/missing.txt'.format(webserver_port)
207 webinc = rootdir.join('webinc.txt') 206 webinc = rootdir.join('webinc.txt')
208 webinc.write('[Adblock]\n%include {}%'.format(url)) 207 webinc.write('[Adblock]\n%include {}%'.format(url))
209 code, err, _ = run_script(str(webinc), str(dstfile)) 208 code, err, _ = run_script(str(webinc), str(dstfile))
210 assert code == 1 209 assert code == 1
211 assert err.startswith( 210 assert err.startswith(
212 "HTTP 404 Not found: '{0}' when including '{0}'".format(url)) 211 "HTTP 404 Not found: '{0}' when including '{0}'".format(url))
OLDNEW
« no previous file with comments | « abp/filters/renderer.py ('k') | tests/test_renderer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld