@@ -41,7 +41,7 @@ def access_point_is_present(access_point_list, access_point_name):
41
41
@dataset ({"access_points_test" : {}})
42
42
class TestAccessPoints (AbstractTestFixture ):
43
43
def test_access_points_with_stop_points (self ):
44
- r = self .query_region ('stop_points?depth=3 ' )
44
+ r = self .query_region ('stop_points?depth=2 ' )
45
45
assert len (get_not_null (r , 'stop_points' )) == 7
46
46
47
47
for sp in r ['stop_points' ]:
@@ -82,7 +82,7 @@ def test_access_points_with_stop_points(self):
82
82
assert ap ['traversal_time' ] == 26
83
83
assert ap ['access_point' ]['access_point_code' ] == "access_point_code_4"
84
84
85
- # without depth=3
85
+ # without depth=2
86
86
r = self .query_region ('stop_points' )
87
87
assert len (get_not_null (r , 'stop_points' )) == 7
88
88
@@ -94,8 +94,15 @@ def test_access_points_with_stop_points(self):
94
94
if sp ['name' ] == 'spC' :
95
95
assert "access_points" not in sp
96
96
97
+ def test_access_points_with_stop_points_depth_1 (self ):
98
+ r = self .query_region ('stop_points?depth=1' )
99
+ assert len (get_not_null (r , 'stop_points' )) == 7
100
+
101
+ for sp in r ['stop_points' ]:
102
+ assert "access_points" not in sp
103
+
97
104
def test_access_points_with_places_nearby (self ):
98
- response = self .query_region ("coords/2.362795;48.872871/places_nearby?depth=3 " )
105
+ response = self .query_region ("coords/2.362795;48.872871/places_nearby?depth=2 " )
99
106
assert len (response ['places_nearby' ]) > 0
100
107
is_valid_places (response ['places_nearby' ])
101
108
@@ -117,6 +124,15 @@ def test_access_points_with_places_nearby(self):
117
124
assert ap ['length' ] == 10
118
125
assert ap ['traversal_time' ] == 23
119
126
127
+ def test_access_points_with_places_nearby_depth_1 (self ):
128
+ response = self .query_region ("coords/2.362795;48.872871/places_nearby?depth=1" )
129
+ assert len (response ['places_nearby' ]) > 0
130
+ is_valid_places (response ['places_nearby' ])
131
+ sp_places_nearby = [sp for sp in response ['places_nearby' ] if sp ["embedded_type" ] == "stop_point" ]
132
+ assert len (sp_places_nearby ) == 6
133
+ for pn in sp_places_nearby :
134
+ assert "access_points" not in pn ['stop_point' ]
135
+
120
136
def test_access_points_api (self ):
121
137
r = self .query_region ('access_points' )
122
138
assert len (get_not_null (r , 'access_points' )) == 3
0 commit comments