From dc352a334b6410ed58c083e9ded8d78a9f2bcb87 Mon Sep 17 00:00:00 2001 From: Manuel Riel Date: Mon, 6 Oct 2014 01:21:34 +0200 Subject: [PATCH] Use \xFF in bin file test --- IPython/html/tests/test_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IPython/html/tests/test_files.py b/IPython/html/tests/test_files.py index fcf371337..bd3eeedae 100644 --- a/IPython/html/tests/test_files.py +++ b/IPython/html/tests/test_files.py @@ -76,7 +76,7 @@ class FilesTest(NotebookTestBase): write(nb, f, format='ipynb') with io.open(pjoin(nbdir, 'test.bin'), 'wb') as f: - f.write(b"\x5F"*3) # \x5F = _ + f.write(b'\xFF' + os.urandom(5)) f.close() with io.open(pjoin(nbdir, 'test.txt'), 'w') as f: @@ -91,7 +91,7 @@ class FilesTest(NotebookTestBase): r = requests.get(url_path_join(base, 'files', 'test.bin')) self.assertEqual(r.status_code, 200) self.assertEqual(r.headers['content-type'], 'application/octet-stream') - self.assertEqual(r.text, '___') + self.assertTrue(r.content.startswith(b'\xFF')) r = requests.get(url_path_join(base, 'files', 'test.txt')) self.assertEqual(r.status_code, 200)