Exemplo n.º 1
0
def test_plotregistry_register():
    reg = plotbase.PlotRegistry()
    reg.remove_all()
    obj = "hello"
    plot_class = plotbase.PlotBase
    reg.register(obj, "test1", plot_class)
    reg.remove_all()
Exemplo n.º 2
0
def test_plotregistry_get():
    reg = plotbase.PlotRegistry()
    reg.remove_all()
    obj = "hello"
    plot_class = plotbase.PlotBase
    reg.register(obj, "test1", plot_class, setup_fn=setup_plot)
    result = reg.get(obj, "test1")
    assert result == (plot_class, obj)
Exemplo n.º 3
0
def test_plotregistry_register_overwrite():
    reg = plotbase.PlotRegistry()
    reg.remove_all()
    obj = "hello"
    plot_class = plotbase.PlotBase
    reg.register(obj, "test1", plot_class)
    # without overwrite: KeyError
    assert pytest.raises(KeyError, reg.register, obj, "test1", plot_class,
                         dict(setup_fn=setup_plot))
    # with overwrite: ok
    reg.register(obj, "test1", plot_class, overwrite=True)
Exemplo n.º 4
0
def test_plotregistry_construct():
    reg = plotbase.PlotRegistry()