File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ class Mesh:
2727
2828 def __init__ (self , meshed_region : dpf .MeshedRegion ):
2929 """Initialize this class."""
30+ if meshed_region is None :
31+ raise ValueError ("Tried to instantiate an empty Mesh." )
3032 self ._meshed_region = meshed_region
3133
3234 def __str__ (self ):
Original file line number Diff line number Diff line change 11import ansys .dpf .core as dpf
22import numpy as np
3+ import pytest
34from pytest import fixture
45
5- from ansys .dpf .post import StaticMechanicalSimulation
6+ from ansys .dpf .post import Mesh , StaticMechanicalSimulation
67
78
89@fixture
@@ -14,6 +15,8 @@ def mesh(static_rst):
1415def test_mesh_core_object (mesh ):
1516 assert isinstance (mesh ._core_object , dpf .MeshedRegion )
1617 assert mesh ._core_object .nodes .n_nodes == 81
18+ with pytest .raises (ValueError , match = "Tried to instantiate an empty Mesh." ):
19+ _ = Mesh (None )
1720
1821
1922def test_mesh_node_ids (mesh ):
You can’t perform that action at this time.
0 commit comments