Skip to content

Commit cfa2f7c

Browse files
committed
Updating test cases
1 parent 7b09ba8 commit cfa2f7c

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

search/tests.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,15 @@ def test_outdoor_info(self):
174174
)
175175
assert outdoor_info is not None and len(outdoor_info) > 0 # Ensure we got outdoor info
176176

177-
def test_airport_info(self):
178-
"""
179-
Tests that airport information can be retrieved
180-
"""
181-
city = "New York City"
182-
country = "US"
183-
184-
airport_info = FourSquarePlacesHelper().get_places(
185-
city=f"{city}, {country}", categories="19040", sort="RELEVANCE", limit=5
186-
)
187-
assert airport_info is not None and len(airport_info) > 0 # Ensure we got airport info
177+
@patch('info.helpers.places.FourSquarePlacesHelper.get_places')
178+
def test_airport_info(self, mock_get_places):
179+
mock_get_places.return_value = [
180+
{"name": "Airport A", "address": "Address A"},
181+
{"name": "Airport B", "address": "Address B"},
182+
]
183+
airport_info = FourSquarePlacesHelper().get_places(city="New York", categories="19040", limit=5)
184+
assert len(airport_info) == 2
185+
assert airport_info[0]["name"] == "Airport A"
188186

189187
def test_arts_info(self):
190188
"""

0 commit comments

Comments
 (0)