Ejemplo n.º 1
0
def test_search_metadata_find_all():
    d = Datasource(name="test_search")

    d._metadata = {"inlet": "100m", "instrument": "violin", "car": "toyota"}

    result = d.search_metadata(search_terms=["100m", "violin", "toyota"], find_all=True)

    assert result is True

    result = d.search_metadata(search_terms=["100m", "violin", "toyota", "swallow"], find_all=True)

    assert result is False
Ejemplo n.º 2
0
def test_search_metadata():
    d = Datasource(name="test_search")

    d._metadata = {"unladen": "swallow", "spam": "eggs"}

    assert d.search_metadata("swallow") == True
    assert d.search_metadata("eggs") == True
    assert d.search_metadata("eggs") == True
    assert d.search_metadata("Swallow") == True

    assert d.search_metadata("beans") == False
    assert d.search_metadata("flamingo") == False