def test_render_as_svg(fake_unlink, fake_factory): fake_env = MagicMock(render_chart_to_file=MagicMock( return_value="fake svg")) fake_factory.return_value = fake_env with jupyter_image("svg"): bar = create_a_bar("test", renderer="svg") svg_content = bar._repr_svg_() fake_unlink.assert_called() eq_(svg_content, "fake svg")
def test_render_as_svg(fake_unlink, fake_factory): fake_env = MagicMock( render_chart_to_file=MagicMock(return_value="fake svg") ) fake_factory.return_value = fake_env with jupyter_image("svg"): bar = create_a_bar("test", renderer="svg") svg_content = bar._repr_svg_() fake_unlink.assert_called() eq_(svg_content, "fake svg")
def test_render_as_svg_with_wrong_configuration(): with jupyter_image("svg"): bar = create_a_bar("test") bar._repr_svg_()
def test_render_as_png_with_wrong_configuration(): with jupyter_image("png"): bar = create_a_bar("test", renderer="svg") bar._repr_png_()
def test_render_as_svg_with_wrong_configuration(): with jupyter_image('svg'): bar = create_a_bar('test') bar._repr_svg_()