##// END OF EJS Templates
Use \xFF in bin file test
Manuel Riel -
Show More
@@ -76,7 +76,7 b' class FilesTest(NotebookTestBase):'
76 write(nb, f, format='ipynb')
76 write(nb, f, format='ipynb')
77
77
78 with io.open(pjoin(nbdir, 'test.bin'), 'wb') as f:
78 with io.open(pjoin(nbdir, 'test.bin'), 'wb') as f:
79 f.write(b"\x5F"*3) # \x5F = _
79 f.write(b'\xFF' + os.urandom(5))
80 f.close()
80 f.close()
81
81
82 with io.open(pjoin(nbdir, 'test.txt'), 'w') as f:
82 with io.open(pjoin(nbdir, 'test.txt'), 'w') as f:
@@ -91,7 +91,7 b' class FilesTest(NotebookTestBase):'
91 r = requests.get(url_path_join(base, 'files', 'test.bin'))
91 r = requests.get(url_path_join(base, 'files', 'test.bin'))
92 self.assertEqual(r.status_code, 200)
92 self.assertEqual(r.status_code, 200)
93 self.assertEqual(r.headers['content-type'], 'application/octet-stream')
93 self.assertEqual(r.headers['content-type'], 'application/octet-stream')
94 self.assertEqual(r.text, '___')
94 self.assertTrue(r.content.startswith(b'\xFF'))
95
95
96 r = requests.get(url_path_join(base, 'files', 'test.txt'))
96 r = requests.get(url_path_join(base, 'files', 'test.txt'))
97 self.assertEqual(r.status_code, 200)
97 self.assertEqual(r.status_code, 200)
General Comments 0
You need to be logged in to leave comments. Login now