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

Unified Diff: tests/test_render_script.py

Issue 29341320: Noissue - Added flake8-abp and pep8-naming extension and fix reported warnings (Closed)
Patch Set: Fixed some broken string literals in Python 2 Created May 12, 2016, 3:27 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « setup.py ('k') | tests/test_renderer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_render_script.py
===================================================================
--- a/tests/test_render_script.py
+++ b/tests/test_render_script.py
@@ -43,7 +43,7 @@
rootdir.join('simple.txt').write('[Adblock]\nOk')
# Fragment with a non-ascii character.
rootdir.join('unicode.txt').write(
- '[Adblock]\n\u1234'.encode('utf-8'), mode='wb')
+ u'[Adblock]\n\u1234'.encode('utf-8'), mode='wb')
Sebastian Noack 2016/05/12 15:31:03 Since, for whatever reason, the qa env did run wit
Sebastian Noack 2016/05/27 12:54:55 I reverted changes of patch set 2. My conclusion a
# Fragment with an include.
rootdir.join('includer.txt').write('[Adblock]\n%include inc:includee.txt%')
# Fragment that includes a circular include file.
@@ -65,13 +65,13 @@
@pytest.fixture
def webserver_port(tmpdir, request):
"""Serve fragments via HTTP on a random port (return the port number)."""
- Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
- httpd = SocketServer.TCPServer(("", 0), Handler)
+ handler = SimpleHTTPServer.SimpleHTTPRequestHandler
+ httpd = SocketServer.TCPServer(('', 0), handler)
port = httpd.socket.getsockname()[1]
# Create some files to serve.
webroot = tmpdir.join('webroot')
webroot.mkdir()
- webroot.join('inc.txt').write('Web \u1234'.encode('utf-8'), mode='wb')
+ webroot.join('inc.txt').write(u'Web \u1234'.encode('utf-8'), mode='wb')
webroot.join('metainc.txt').write(
'%include http://localhost:{}/inc.txt%'.format(port))
# Change to this directory and start the webserver in another thread.
@@ -107,7 +107,7 @@
def test_render_unicode(rootdir, dstfile):
code, err = run_script(str(rootdir.join('unicode.txt')), str(dstfile))
- assert '\u1234' in dstfile.read(mode='rb').decode('utf-8')
+ assert u'\u1234' in dstfile.read(mode='rb').decode('utf-8')
def test_render_with_includes(rootdir, dstfile):
@@ -178,7 +178,7 @@
webinc = rootdir.join('webinc.txt')
webinc.write('[Adblock]\n%include {}%'.format(url))
code, err = run_script(str(webinc), str(dstfile))
- assert 'Web \u1234' in dstfile.read(mode='rb').decode('utf-8')
+ assert u'Web \u1234' in dstfile.read(mode='rb').decode('utf-8')
@pytest.mark.slowtest
« no previous file with comments | « setup.py ('k') | tests/test_renderer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld