Beispiel #1
0
def test_tag_empty(collection_1, collection_2, collection_3, way_residential,
                   way_residential_no):
    empty = TagEmpty('tiger:reviewed')
    assert not empty.match_way(way_residential_no)
    assert empty.match_way(way_residential)
    assert empty.match_collection(collection_1)
    assert empty.match(way_residential)
    assert not empty.match(way_residential_no)
    assert empty.match(collection_1)
    assert empty.match(collection_2)
    assert not empty.match(collection_3)
Beispiel #2
0
def test_or(way_residential_no, way_residential, way_unclassified,
            way_unclassified_no):
    both = Or(TagEquals('highway', 'residential'), TagEmpty('tiger:reviewed'))
    assert both.match(way_residential)
    assert both.match(way_residential_no)
    assert both.match(way_unclassified)
    assert not both.match(way_unclassified_no)
Beispiel #3
0
def test_and_collections(collection_1, collection_2, collection_3,
                         collection_4):
    both = And(TagEquals('highway', 'residential'), TagEmpty('tiger:reviewed'))
    assert both.match(collection_1)
    assert not both.match(collection_2)
    assert not both.match(collection_3)
    assert both.match(collection_4)
Beispiel #4
0
def test_tag_empty(collection_1, collection_2, collection_3, way_residential, way_residential_no):
    empty = TagEmpty('tiger:reviewed')
    assert not empty.match_way(way_residential_no)
    assert empty.match_way(way_residential)
    assert empty.match_collection(collection_1)
    assert empty.match(way_residential)
    assert not empty.match(way_residential_no)
    assert empty.match(collection_1)
    assert empty.match(collection_2)
    assert not empty.match(collection_3)
Beispiel #5
0
def test_and_ways(way_residential_no, way_residential, way_unclassified,
                  way_unclassified_no):
    both = And(TagEquals('highway', 'residential'), TagEmpty('tiger:reviewed'))
    assert both.match(way_residential)
    assert not both.match(way_residential_no)

    both = And(TagEquals('highway', 'residential'),
               TagEquals('tiger:reviewed', 'no'))
    assert both.match(way_residential_no)
    assert not both.match(way_residential)
    assert not both.match(way_unclassified_no)