@@ -379,3 +379,48 @@ def test_database_uri_path(client: FlaskClient) -> None:
379379 assert app .config ["SQLALCHEMY_DATABASE_URI" ] == expected_uri
380380
381381 assert os .path .exists (expected_db_path )
382+
383+
384+ def test_geode_object_inheritance (client : FlaskClient ) -> None :
385+ route = "/opengeodeweb_back/geode_object_inheritance"
386+ # Test BRep
387+ response = client .post (route , json = {"geode_object_type" : "BRep" })
388+ assert response .status_code == 200
389+ json_data = response .get_json ()
390+ parents = json_data ["parents" ]
391+ children = json_data ["children" ]
392+ assert "BRep" not in parents
393+ assert "BRep" not in children
394+ # Descendants
395+ assert "StructuralModel" in children
396+ assert "ImplicitStructuralModel" in children
397+
398+ # Test CrossSection
399+ response = client .post (route , json = {"geode_object_type" : "CrossSection" })
400+ assert response .status_code == 200
401+ json_data = response .get_json ()
402+ parents = json_data ["parents" ]
403+ children = json_data ["children" ]
404+ assert "CrossSection" not in parents
405+ assert "CrossSection" not in children
406+ # Parent
407+ assert "Section" in parents
408+ # Descendant
409+ assert "ImplicitCrossSection" in children
410+
411+ # Test PolyhedralSolid3D
412+ response = client .post (route , json = {"geode_object_type" : "PolyhedralSolid3D" })
413+ assert response .status_code == 200
414+ json_data = response .get_json ()
415+ parents = json_data ["parents" ]
416+ children = json_data ["children" ]
417+ assert "PolyhedralSolid3D" not in parents
418+ assert "PolyhedralSolid3D" not in children
419+ # Parent
420+ assert "VertexSet" in parents
421+
422+ # Test all params
423+ def get_full_data () -> test_utils .JsonData :
424+ return {"geode_object_type" : "BRep" }
425+
426+ test_utils .test_route_wrong_params (client , route , get_full_data )
0 commit comments