Skip to content

Commit 69ea251

Browse files
authored
A list of 5 elements for the bounding box should raise an exception. (#1305)
1 parent 42cd90e commit 69ea251

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

_unittest/test_02_2D_modeler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,6 @@ def test_12_objects_in_bounding_box(self):
167167
with pytest.raises(ValueError):
168168
bounding_box = [3, 4, 5]
169169
self.aedtapp.modeler.objects_in_bounding_box(bounding_box)
170+
with pytest.raises(ValueError):
171+
bounding_box_5_elements = [1, 2, 3, 4, 5]
172+
self.aedtapp.modeler.objects_in_bounding_box(bounding_box_5_elements)

pyaedt/modeler/Model2D.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def objects_in_bounding_box(self, bounding_box, check_lines=True, check_sheets=T
156156
list of :class:`pyaedt.modeler.Object3d`
157157
"""
158158

159-
if len(bounding_box) not in [4, 6]:
159+
if len(bounding_box) != 4 and len(bounding_box) != 6:
160160
raise ValueError("Bounding box must be a list of 4 or 6 elements.")
161161

162162
if len(bounding_box) == 4:

0 commit comments

Comments
 (0)