From 88753b52c7c2c992545b29ca118a0723391d2f35 2013-09-05 21:53:39 From: MinRK Date: 2013-09-05 21:53:39 Subject: [PATCH] test binary data passed to output data is coerced to unicode (cast with 'replace', so no errors) --- diff --git a/IPython/nbformat/v3/tests/test_nbbase.py b/IPython/nbformat/v3/tests/test_nbbase.py index 67b4b79..2d137b8 100644 --- a/IPython/nbformat/v3/tests/test_nbbase.py +++ b/IPython/nbformat/v3/tests/test_nbbase.py @@ -141,3 +141,17 @@ class TestMetadata(TestCase): self.assertEqual(md.gistid, u'21341231') self.assertEqual(md.authors, authors) +class TestOutputs(TestCase): + def test_binary_png(self): + out = new_output(output_png=b'\x89PNG\r\n\x1a\n') + + def test_b64b6tes_png(self): + out = new_output(output_png=b'iVBORw0KG') + + def test_binary_jpeg(self): + out = new_output(output_jpeg=b'\xff\xd8') + + def test_b64b6tes_jpeg(self): + out = new_output(output_jpeg=b'/9') + +