Skip to content

Commit

Permalink
Tests for Features.__contains__
Browse files Browse the repository at this point in the history
Closes #23
  • Loading branch information
clarisma committed Dec 7, 2023
1 parent 2e67b90 commit 67592d1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/test_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ def test_contains(features):
highways = features("w[highway]")
sushi_restaurants = features("na[amenity=restaurant][cuisine=sushi]")
restaurant = sushi_restaurants[0]
street = highways[0]
assert restaurant in sushi_restaurants
assert highways[0] not in sushi_restaurants

assert street not in sushi_restaurants
for node in street.nodes:
assert node in street.nodes
assert node not in sushi_restaurants

def test_contains_member(features):
routes = features("r[route]")
route = routes[0]
for member in route.members:
assert member in route.members
assert route in member.parents
assert route in member.parents.relations

0 comments on commit 67592d1

Please sign in to comment.