Skip to content

Commit

Permalink
covering exception in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chamel3 committed Aug 7, 2024
1 parent 97e3347 commit dc8babd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test_ReadExodusMesh.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pathlib # to reach sample mesh file
import pytest
import sys
import unittest

Expand Down Expand Up @@ -163,6 +164,12 @@ def test_property_mins_and_maxs(self):
self.assertAlmostEqual(np.max(self.props, axis=0)[0], 1.38727616, 8)
self.assertAlmostEqual(np.max(self.props, axis=0)[1], 12.48548545, 8)

def test_bad_property_names(self):
with pytest.raises(KeyError):
self.props = ReadExodusMesh.read_exodus_mesh_element_properties(
pathlib.Path(__file__).parent.joinpath('read_material_property_test.exo'),
['bulk1', 'shear1'], blockNum=1
)

if __name__ == '__main__':
unittest.main()

0 comments on commit dc8babd

Please sign in to comment.