Exemple #1
0
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")
Exemple #2
0
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")
Exemple #3
0
def test_render_as_svg_with_wrong_configuration():
    with jupyter_image("svg"):
        bar = create_a_bar("test")
        bar._repr_svg_()
Exemple #4
0
def test_render_as_png_with_wrong_configuration():
    with jupyter_image("png"):
        bar = create_a_bar("test", renderer="svg")
        bar._repr_png_()
Exemple #5
0
def test_render_as_svg_with_wrong_configuration():
    with jupyter_image('svg'):
        bar = create_a_bar('test')
        bar._repr_svg_()