Exemplo n.º 1
0
def test__find_legend_item():
    legend = Legend(items=[
        LegendItem(label=dict(value="foo")),
        LegendItem(label=dict(field="bar"))
    ])
    assert bpl._find_legend_item(dict(value="baz"), legend) is None
    assert bpl._find_legend_item(dict(value="foo"), legend) is legend.items[0]
    assert bpl._find_legend_item(dict(field="bar"), legend) is legend.items[1]
Exemplo n.º 2
0
def test__find_legend_item() -> None:
    legend = Legend(items=[LegendItem(label=value("foo")), LegendItem(label=field("bar"))])
    assert bpl._find_legend_item(value("baz"), legend) is None
    assert bpl._find_legend_item(value("foo"), legend) is legend.items[0]
    assert bpl._find_legend_item(field("bar"), legend) is legend.items[1]