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 |