From 69d48a37f963891d521129d788c9e5d1294f5e4d Mon Sep 17 00:00:00 2001 From: jairomelo Date: Mon, 14 Jul 2025 20:22:16 -0400 Subject: [PATCH] fix: update test_geonames_query to assert coordinates as a dict with latitude and longitude --- tests/test_resolver.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_resolver.py b/tests/test_resolver.py index 0e3a261..c434a98 100644 --- a/tests/test_resolver.py +++ b/tests/test_resolver.py @@ -15,6 +15,7 @@ def test_geonames_query(): place_type = "city" coordinates = resolver.resolve(place_name, country_code, place_type) - assert coordinates[0] is not None, "Coordinates should not be None" - assert isinstance(coordinates, tuple), "Coordinates should be a tuple" - assert len(coordinates) == 2, "Coordinates should contain latitude and longitude" \ No newline at end of file + assert coordinates is not None, "1. Coordinates should not be None" + assert isinstance(coordinates, dict), "2. Coordinates should be a dict" + assert "latitude" in coordinates and "longitude" in coordinates, "3. Coordinates should contain latitude and longitude" + assert coordinates["latitude"] == 40.71427 and coordinates["longitude"] == -74.00597, f"4. Coordinates {coordinates} do not match expected values for New York, US" \ No newline at end of file