Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions python/sedonadb/tests/functions/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ def test_st_asbinary(eng, geom, expected):
eng.assert_query_result(f"SELECT ST_AsBinary({geom_or_null(geom)})", expected)


@pytest.mark.parametrize("eng", [SedonaDB])
def test_st_aswkb_alias(eng):
eng = eng.create_or_skip()
eng.assert_query_result(
"SELECT ST_AsWKB(ST_Point(1, 2)) = ST_AsBinary(ST_Point(1, 2))", True
)


@pytest.mark.parametrize("eng", [SedonaDB, PostGIS])
@pytest.mark.parametrize(
("geom"),
Expand Down Expand Up @@ -122,6 +130,12 @@ def test_st_astext(eng, geom):
eng.assert_query_result(f"SELECT ST_AsText({geom_or_null(geom)})", expected)


@pytest.mark.parametrize("eng", [SedonaDB])
def test_st_aswkt_alias(eng):
eng = eng.create_or_skip()
eng.assert_query_result("SELECT ST_AsWKT(ST_Point(1, 2))", "POINT(1 2)")


@pytest.mark.parametrize("eng", [SedonaDB, PostGIS])
@pytest.mark.parametrize(
("geom", "expected"),
Expand Down Expand Up @@ -1681,6 +1695,12 @@ def test_st_force_dim(eng, geom, expected_2d, expected_3d):
eng.assert_query_result(f"SELECT ST_Force3D({geom_or_null(geom)}, 5)", expected_3d)


@pytest.mark.parametrize("eng", [SedonaDB])
def test_st_force3dz_alias(eng):
eng = eng.create_or_skip()
eng.assert_query_result("SELECT ST_Force3DZ(ST_Point(1, 2), 3)", "POINT Z (1 2 3)")


@pytest.mark.parametrize("eng", [SedonaDB, PostGIS])
@pytest.mark.parametrize(
("geom", "m", "expected_without_m", "expected_with_m"),
Expand Down Expand Up @@ -2271,6 +2291,12 @@ def test_st_geomfromtext_with_srid(eng, wkt, srid, expected):
)


@pytest.mark.parametrize("eng", [SedonaDB])
def test_st_geometryfromtext_alias(eng):
eng = eng.create_or_skip()
eng.assert_query_result("SELECT ST_GeometryFromText('POINT (1 2)')", "POINT (1 2)")


@pytest.mark.parametrize("eng", [SedonaDB, PostGIS])
@pytest.mark.parametrize(
("ewkt", "expected", "expected_srid"),
Expand Down