feat(projects): automate project infrastructure provisioning
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
from app.native.wndb.core.model_replace import _copy_out_statement
|
||||
|
||||
|
||||
def test_copy_out_statement_relabels_project_geometry_to_target_srid() -> None:
|
||||
statement = _copy_out_statement(
|
||||
"gis",
|
||||
"labels",
|
||||
["id", "label", "geom"],
|
||||
source_geometry_srids={"geom": 900914},
|
||||
target_geometry_srids={"geom": 990001},
|
||||
)
|
||||
|
||||
assert statement.as_string(None) == (
|
||||
'copy (select "id", "label", '
|
||||
'st_setsrid("geom", 990001) as "geom" '
|
||||
'from "gis"."labels") to stdout'
|
||||
)
|
||||
|
||||
|
||||
def test_copy_out_statement_keeps_direct_copy_when_srid_matches() -> None:
|
||||
statement = _copy_out_statement(
|
||||
"gis",
|
||||
"node_geometries",
|
||||
["node_id", "geom"],
|
||||
source_geometry_srids={"geom": 900914},
|
||||
target_geometry_srids={"geom": 900914},
|
||||
)
|
||||
|
||||
assert statement.as_string(None) == (
|
||||
'copy "gis"."node_geometries" ("node_id", "geom") to stdout'
|
||||
)
|
||||
Reference in New Issue
Block a user