From 0ca23b4f7d1943fa63e4bf2096307735afefc854 2015-04-16 10:24:55 From: sukisuki Date: 2015-04-16 10:24:55 Subject: [PATCH] added basic test - ensure video embedding doesn't outright fail - check that the generated url is correct --- diff --git a/IPython/core/tests/test_display.py b/IPython/core/tests/test_display.py index fca6963..5d827e3 100644 --- a/IPython/core/tests/test_display.py +++ b/IPython/core/tests/test_display.py @@ -2,6 +2,7 @@ # Distributed under the terms of the Modified BSD License. import json +import tempfile import os import warnings @@ -149,4 +150,12 @@ def test_json(): nt.assert_equal(len(w), 1) nt.assert_equal(j._repr_json_(), lis) - +def test_video_embedding(): + """use a tempfile, with dummy-data, to ensure that video embedding doesn't crash""" + with tempfile.NamedTemporaryFile(suffix='.mp4') as f: + with open(f.name,'wb') as f: + f.write(b'abc') + + v = display.Video(f.name, embed=True) + html = v._repr_html_() + nt.assert_in('src="data:video/mp4;base64,YWJj"',html)