Skip to content

Commit 3cc448b

Browse files
committed
new architecture for tests
1 parent 65a335a commit 3cc448b

17 files changed

+2380
-1929
lines changed

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ def server(xprocess: XProcess) -> Generator[ServerMonitor, None, None]:
193193

194194
@pytest.fixture(scope="session", autouse=True)
195195
def configure_test_environment() -> Generator[None, None, None]:
196-
project_root = Path(__file__).parent.parent.parent.absolute()
197-
os.environ["DATA_FOLDER_PATH"] = str(project_root / "tests" / "data")
196+
project_root = Path(__file__).parent.absolute()
197+
os.environ["DATA_FOLDER_PATH"] = str(project_root / "data")
198198

199199
config.test_config()
200200
db_path = Path(os.environ["DATA_FOLDER_PATH"]) / "project.db"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<VTKFile type="PolyData" version="1.0" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
3+
<PolyData>
4+
<Piece NumberOfPoints="30" NumberOfLines="96">
5+
<PointData>
6+
<DataArray type="Float64" Name="vertex_attribute" format="ascii" NumberOfComponents="1" RangeMin="0" RangeMax="58">0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 </DataArray>
7+
<DataArray type="Float64" Name="points" format="ascii" NumberOfComponents="3" RangeMin="0" RangeMax="5">0 0 0 3 0 0 3 3 0 0 3 0 0 0 4 3 0 4 3 3 4 0 3 4 1 1 1 2 1 1 2 2 1 1 2 1 1 1 2 2 1 2 2 2 2 1 2 2 1 1 3 2 1 3 2 2 3 1 2 3 4 1 1 5 1 1 5 2 1 4 2 1 4 1 3 5 1 3 5 2 3 4 2 3 1 1 3.5 1 2 3.5 </DataArray>
8+
</PointData>
9+
<Points>
10+
<DataArray type="Float64" Name="Points" format="ascii" NumberOfComponents="3" RangeMin="0" RangeMax="5">0 0 0 3 0 0 3 3 0 0 3 0 0 0 4 3 0 4 3 3 4 0 3 4 1 1 1 2 1 1 2 2 1 1 2 1 1 1 2 2 1 2 2 2 2 1 2 2 1 1 3 2 1 3 2 2 3 1 2 3 4 1 1 5 1 1 5 2 1 4 2 1 4 1 3 5 1 3 5 2 3 4 2 3 1 1 3.5 1 2 3.5 </DataArray>
11+
</Points>
12+
<CellData>
13+
<DataArray type="Float64" Name="edges" format="ascii" NumberOfComponents="2" RangeMin="0" RangeMax="29">0 1 1 2 2 3 3 0 0 1 1 5 5 4 4 0 1 2 2 6 6 5 5 1 3 2 2 6 6 7 7 3 4 5 5 6 6 7 7 4 0 3 3 7 7 4 4 0 8 9 9 10 10 11 11 8 12 13 13 14 14 15 15 12 16 17 17 18 18 19 19 16 8 9 9 13 13 12 12 8 12 13 13 17 17 16 16 12 9 10 10 14 14 13 13 9 13 14 14 18 18 17 17 13 11 10 10 14 14 15 15 11 15 14 14 18 18 19 19 15 8 11 11 15 15 12 12 8 12 15 15 19 19 16 16 12 20 21 21 22 22 23 23 20 20 21 21 25 25 24 24 20 21 22 22 26 26 25 25 21 23 22 22 26 26 27 27 23 24 25 25 26 26 27 27 24 20 23 23 27 27 24 24 20 16 19 19 29 29 28 28 16 </DataArray>
14+
<DataArray type="Float64" Name="edge_attribute" format="ascii" NumberOfComponents="1" RangeMin="0" RangeMax="190">0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 </DataArray>
15+
</CellData>
16+
<Lines>
17+
<DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="29">0 1 1 2 2 3 3 0 0 1 1 5 5 4 4 0 1 2 2 6 6 5 5 1 3 2 2 6 6 7 7 3 4 5 5 6 6 7 7 4 0 3 3 7 7 4 4 0 8 9 9 10 10 11 11 8 12 13 13 14 14 15 15 12 16 17 17 18 18 19 19 16 8 9 9 13 13 12 12 8 12 13 13 17 17 16 16 12 9 10 10 14 14 13 13 9 13 14 14 18 18 17 17 13 11 10 10 14 14 15 15 11 15 14 14 18 18 19 19 15 8 11 11 15 15 12 12 8 12 15 15 19 19 16 16 12 20 21 21 22 22 23 23 20 20 21 21 25 25 24 24 20 21 22 22 26 26 25 25 21 23 22 22 26 26 27 27 23 24 25 25 26 26 27 27 24 20 23 23 27 27 24 24 20 16 19 19 29 29 28 28 16 </DataArray>
18+
<DataArray type="Int64" Name="offsets" format="ascii" RangeMin="0" RangeMax="30">2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 </DataArray>
19+
</Lines>
20+
</Piece>
21+
</PolyData>
22+
</VTKFile>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0"?>
2+
<VTKFile type="PolyData" version="1.0" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
3+
<PolyData>
4+
<Piece NumberOfPoints="4" NumberOfLines="4">
5+
<PointData>
6+
<DataArray type="Float64" Name="points" format="ascii" NumberOfComponents="3" RangeMin="0.100000001" RangeMax="9.39999962">0.1 0.2 0.3 2.1 9.4 6.7 7.5 5.2 6.3 8.7 1.4 4.7 </DataArray>
7+
</PointData>
8+
<Points>
9+
<DataArray type="Float64" Name="Points" format="ascii" NumberOfComponents="3" RangeMin="0.10000000000000001" RangeMax="9.4000000000000004">0.1 0.2 0.3 2.1 9.4 6.7 7.5 5.2 6.3 8.7 1.4 4.7 </DataArray>
10+
</Points>
11+
<CellData>
12+
<DataArray type="Float64" Name="edges" format="ascii" NumberOfComponents="2" RangeMin="0" RangeMax="3">0 1 0 2 3 2 1 2 </DataArray>
13+
</CellData>
14+
<Lines>
15+
<DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="3">0 1 0 2 3 2 1 2 </DataArray>
16+
<DataArray type="Int64" Name="offsets" format="ascii" RangeMin="0" RangeMax="4">2 4 6 8 </DataArray>
17+
</Lines>
18+
</Piece>
19+
</PolyData>
20+
</VTKFile>

tests/data/123456789/hat.vtp

Lines changed: 19 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
3+
<UnstructuredGrid>
4+
<Piece NumberOfPoints="11" NumberOfCells="4">
5+
<PointData>
6+
<DataArray type="Float64" Name="toto_on_vertices" format="ascii" NumberOfComponents="1" RangeMin="1" RangeMax="11">1 2 3 4 5 6 7 8 9 10 11 </DataArray>
7+
<DataArray type="Float64" Name="points" format="ascii" NumberOfComponents="3" RangeMin="0" RangeMax="2">0 0 0 1 0 0 2 1 0 1 2 0 0 2 0 0 0 1 1 0 1 2 1 1 1 2 1 0 2 1 1 1 2 </DataArray>
8+
</PointData>
9+
<Points>
10+
<DataArray type="Float64" Name="Points" format="ascii" NumberOfComponents="3" RangeMin="0" RangeMax="2">0 0 0 1 0 0 2 1 0 1 2 0 0 2 0 0 0 1 1 0 1 2 1 1 1 2 1 0 2 1 1 1 2 </DataArray>
11+
</Points>
12+
<CellData>
13+
<DataArray type="Float64" Name="toto_on_polyhedra" format="ascii" NumberOfComponents="1" RangeMin="3" RangeMax="6">3 4 5 6 </DataArray>
14+
</CellData>
15+
<Cells>
16+
<DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="10">0 1 3 4 5 6 8 9 1 2 3 6 7 8 5 6 8 9 10 6 7 8 10 </DataArray>
17+
<DataArray type="Int64" Name="offsets" format="ascii" RangeMin="0" RangeMax="11">8 14 19 23 </DataArray>
18+
<DataArray type="UInt8" Name="types" format="ascii" RangeMin="1" RangeMax="42">12 13 14 10 </DataArray>
19+
</Cells>
20+
</Piece>
21+
</UnstructuredGrid>
22+
</VTKFile>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<VTKFile type="PolyData" version="1.0" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
3+
<PolyData>
4+
<Piece NumberOfPoints="46" NumberOfPolys="46">
5+
<PointData>
6+
<DataArray type="Float64" Name="points" format="ascii" NumberOfComponents="2" RangeMin="-61.7243652" RangeMax="76.1532211">-61.7244 14.6963 -60.8099 -0.979751 -56.2378 27.1065 -43.1744 -5.29066 -38.8635 22.1424 -16.3945 -4.63749 -15.0882 19.791 16.5252 22.7956 20.1829 -4.76813 35.9895 -5.4213 40.3005 24.8857 41.3455 4.11496 42.6519 13.1287 33.7787 9.14871 41.0601 23.4894 41.9389 13.273 37.3251 -4.85291 42.2685 4.15511 51.0568 24.4781 54.682 -5.95145 68.5236 23.3796 71.0502 14.7011 71.4896 -6.94013 73.9064 1.62847 58.4724 7.35799 59.7405 17.2398 50.9449 17.0185 -60.8195 -1.62315 -59.9003 -12.2605 -56.4858 -21.5847 -41.7773 -5.69425 -33.1098 -28.0196 -20.3712 -4.9063 -1.46031 -27.757 0.640906 -5.16895 14.1675 -27.8883 16.9253 -5.03762 36.2302 -5.69425 40.4326 -27.1003 49.1001 -5.82558 67.6171 -30.6461 71.1628 -7.53281 74.446 -15.5437 76.1532 -25.2618 65.4426 -17.0775 52.7354 -17.3143 </DataArray>
7+
</PointData>
8+
<Points>
9+
<DataArray type="Float64" Name="Points" format="ascii" NumberOfComponents="3" RangeMin="-61.724365234375" RangeMax="76.153221130371094">-61.724365234375 14.6962766647339 0 -60.8099250793457 -0.979751348495483 0 -56.2377586364746 27.1064682006836 0 -43.1743965148926 -5.29066038131714 0 -38.8634872436523 22.142391204834 0 -16.3945140838623 -4.63749170303345 0 -15.0881767272949 19.7909870147705 0 16.5251502990723 22.7955627441406 0 20.18288230896 -4.76812744140625 0 35.9895477294922 -5.42129564285278 0 40.3004531860352 24.8856983184814 0 41.3455276489258 4.11495876312256 0 42.65185546875 13.1286745071411 0 33.7787322998047 9.14871406555176 0 41.0600929260254 23.4894065856934 0 41.9389266967773 13.2729911804199 0 37.325065612793 -4.8529109954834 0 42.2684898376465 4.15511226654053 0 51.0568084716797 24.4780941009521 0 54.6819877624512 -5.95145130157471 0 68.5235900878906 23.3795547485352 0 71.0502166748047 14.7010917663574 0 71.4896469116211 -6.94013404846191 0 73.9064254760742 1.62847137451172 0 58.4723815917969 7.35799360275269 0 59.7404937744141 17.2398090362549 0 50.9449157714844 17.0184726715088 0 -60.8195457458496 -1.62315285205841 0 -59.9002723693848 -12.2605400085449 0 -56.4857978820801 -21.5846691131592 0 -41.7773132324219 -5.694251537323 0 -33.1098175048828 -28.0196323394775 0 -20.3712139129639 -4.90629720687866 0 -1.46030735969543 -27.7569789886475 0 0.640906095504761 -5.16894960403442 0 14.1674613952637 -27.8883056640625 0 16.9253005981445 -5.03762483596802 0 36.2301902770996 -5.694251537323 0 40.4326171875 -27.1003494262695 0 49.1001129150391 -5.8255763053894 0 67.6170501708984 -30.6461448669434 0 71.162841796875 -7.53281211853027 0 74.4459838867188 -15.5436840057373 0 76.1532211303711 -25.261791229248 0 65.4426422119141 -17.0774612426758 0 52.7353782653809 -17.3142528533936 0 </DataArray>
10+
</Points>
11+
<CellData>
12+
<DataArray type="Float64" Name="triangle_vertices" format="ascii" NumberOfComponents="3" RangeMin="0" RangeMax="45">6 5 4 4 0 2 3 1 0 8 6 7 5 3 4 13 9 8 4 3 0 13 8 7 8 5 6 13 7 10 13 11 9 13 12 11 13 10 12 24 19 17 24 22 19 24 17 15 26 24 15 26 14 18 24 21 23 25 21 24 25 18 20 19 16 17 25 20 21 26 25 24 24 23 22 26 15 14 26 18 25 32 31 30 44 42 43 36 35 34 44 39 41 45 44 40 31 29 30 37 35 36 30 28 27 30 29 28 45 38 37 44 43 40 45 39 44 44 41 42 45 40 38 45 37 39 35 33 34 33 31 32 34 33 32 38 35 37 </DataArray>
13+
<DataArray type="Float64" Name="triangle_adjacents" format="ascii" NumberOfComponents="3" RangeMin="0" RangeMax="4.2949673e+09">8 4 4.29497e+09 6 4.29497e+09 4.29497e+09 4.29497e+09 4.29497e+09 6 8 4.29497e+09 7 4.29497e+09 6 0 10 4.29497e+09 7 4 2 1 5 3 9 4.29497e+09 0 3 7 4.29497e+09 12 11 4.29497e+09 5 12 4.29497e+09 10 9 4.29497e+09 11 14 21 15 24 4.29497e+09 13 13 4.29497e+09 16 23 15 25 25 4.29497e+09 26 19 4.29497e+09 24 22 18 23 26 4.29497e+09 22 4.29497e+09 4.29497e+09 13 20 4.29497e+09 19 26 19 16 18 4.29497e+09 14 16 4.29497e+09 17 17 20 23 43 32 4.29497e+09 39 4.29497e+09 37 33 42 4.29497e+09 38 4.29497e+09 39 38 37 40 4.29497e+09 35 27 45 29 4.29497e+09 35 4.29497e+09 4.29497e+09 32 4.29497e+09 34 40 45 41 28 4.29497e+09 31 41 30 31 30 4.29497e+09 28 31 4.29497e+09 36 36 4.29497e+09 38 4.29497e+09 44 29 4.29497e+09 27 44 42 43 4.29497e+09 4.29497e+09 33 36 </DataArray>
14+
</CellData>
15+
<Polys>
16+
<DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="45">6 5 4 4 0 2 3 1 0 8 6 7 5 3 4 13 9 8 4 3 0 13 8 7 8 5 6 13 7 10 13 11 9 13 12 11 13 10 12 24 19 17 24 22 19 24 17 15 26 24 15 26 14 18 24 21 23 25 21 24 25 18 20 19 16 17 25 20 21 26 25 24 24 23 22 26 15 14 26 18 25 32 31 30 44 42 43 36 35 34 44 39 41 45 44 40 31 29 30 37 35 36 30 28 27 30 29 28 45 38 37 44 43 40 45 39 44 44 41 42 45 40 38 45 37 39 35 33 34 33 31 32 34 33 32 38 35 37 </DataArray>
17+
<DataArray type="Int64" Name="offsets" format="ascii" RangeMin="0" RangeMax="46">3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 </DataArray>
18+
</Polys>
19+
</Piece>
20+
</PolyData>
21+
</VTKFile>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Standard library imports
2+
from typing import Callable
3+
4+
# Third party imports
5+
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView
6+
from opengeodeweb_viewer.rpc.mesh.edges.attribute.edge.edges_attribute_edge_protocols import (
7+
VtkMeshEdgesAttributeEdgeView,
8+
)
9+
10+
# Local application imports
11+
from tests.conftest import ServerMonitor
12+
13+
# Local constants
14+
mesh_id = "123456789"
15+
16+
17+
def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None:
18+
19+
dataset_factory(
20+
id=mesh_id,
21+
viewable_file="attributed_edged_curve.vtp",
22+
viewer_elements_type="edges",
23+
)
24+
25+
server.call(
26+
VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"],
27+
[{"id": mesh_id}],
28+
)

0 commit comments

Comments
 (0)