[test] lambda_handler: update test cases assertions
Browse files- tests/test_app.py +12 -6
tests/test_app.py
CHANGED
@@ -182,10 +182,16 @@ class TestAppFailures(unittest.TestCase):
|
|
182 |
assert body_dict["request_id"] == invoke_id
|
183 |
assert body_dict["message"] == "ok"
|
184 |
assert body_dict["n_shapes_geojson"] == expected_response_body["n_shapes_geojson"]
|
|
|
185 |
output_geojson = shapely.from_geojson(body_dict["geojson"])
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
182 |
assert body_dict["request_id"] == invoke_id
|
183 |
assert body_dict["message"] == "ok"
|
184 |
assert body_dict["n_shapes_geojson"] == expected_response_body["n_shapes_geojson"]
|
185 |
+
|
186 |
output_geojson = shapely.from_geojson(body_dict["geojson"])
|
187 |
+
print("output_geojson::", type(output_geojson))
|
188 |
+
assert isinstance(output_geojson, shapely.GeometryCollection)
|
189 |
+
assert len(output_geojson.geoms) == expected_response_body["n_shapes_geojson"]
|
190 |
+
|
191 |
+
if json_filename == "single_point":
|
192 |
+
try:
|
193 |
+
assert shapely.equals_exact(expected_output_geojson, output_geojson, tolerance=0.000006)
|
194 |
+
except AssertionError as ae:
|
195 |
+
print(f"json filename: {fn_name}_{json_filename}.json")
|
196 |
+
assert expected_response_body["geojson"] == body_dict["geojson"]
|
197 |
+
raise ae
|