File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -401,6 +401,10 @@ def solve(self) -> "Assembly":
401
401
for c in self .constraints :
402
402
constraints .append (((ents [c .objects [0 ]], ents [c .objects [1 ]]), c .toPOD ()))
403
403
404
+ # check if any constraints were specified
405
+ if not constraints :
406
+ raise ValueError ("At least one constraint required" )
407
+
404
408
# instantiate the solver
405
409
solver = ConstraintSolver (locs , constraints , locked = [lock_ix ])
406
410
Original file line number Diff line number Diff line change @@ -212,3 +212,9 @@ def test_duplicate_name(nested_assy):
212
212
213
213
with pytest .raises (ValueError ):
214
214
nested_assy .add (None , name = "SECOND" )
215
+
216
+
217
+ def test_empty_solve (nested_assy ):
218
+
219
+ with pytest .raises (ValueError ):
220
+ nested_assy .solve ()
You can’t perform that action at this time.
0 commit comments