Skip to content

Commit

Permalink
Add test for invalid rotatable data types
Browse files Browse the repository at this point in the history
  • Loading branch information
drewj-tp committed Sep 20, 2024
1 parent ca410f0 commit 586b850
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions armi/utils/tests/test_hexagon.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,16 @@ def test_emptyRotate(self):
empty = np.array(empty)
post = hexagon.rotateHexCellData(empty, 2)
self.assertIs(post, empty)

def test_invalidTypes(self):
"""Test we can only rotate lists and arrays."""
invalidData = [
set(),
2,
False,
{1: True},
(0, 1, 2, 3, 4, 5, 6, 7),
]
for data in invalidData:
with self.assertRaises(TypeError, msg=f"{invalidData=}"):
hexagon.rotateHexCellData(data, 5)

0 comments on commit 586b850

Please sign in to comment.