diff --git a/tests/test_footprint_generator.py b/tests/test_footprint_generator.py index 9638c01..b75c89e 100644 --- a/tests/test_footprint_generator.py +++ b/tests/test_footprint_generator.py @@ -227,7 +227,26 @@ def test_lambda_handler_cumulus(mocked_get): results = aws_s3.Object(bucket, key).load() generated_footprint = True assert generated_footprint + + +def compare_shapes(wkt1, wkt2): + """ + Compares two WKT shapes and returns True if they are identical, False otherwise. + + Parameters: + wkt1 (str): Well-Known Text (WKT) representation of the first shape. + wkt2 (str): Well-Known Text (WKT) representation of the second shape. + Returns: + bool: True if the shapes are identical, False otherwise. + """ + # Convert WKT to Shapely geometries + shape1 = wkt.loads(wkt1) + shape2 = wkt.loads(wkt2) + + # Check if the shapes are identical + return shape1.equals(shape2) + def test_forge_py(): @@ -258,4 +277,4 @@ def test_forge_py(): lat_data = ds[latitude_var] wkt_alphashape = forge.generate_footprint(lon_data, lat_data, thinning_fac=thinning_fac, alpha=alpha, is360=is360, simplify=simplify, strategy=strategy) - assert wkt_alphashape == polygon_shape + assert compare_shapes(wkt_alphashape, polygon_shape)