Skip to content

Commit

Permalink
Add constraint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vespakoen committed Jan 15, 2023
1 parent 6b82f10 commit b279b06
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions testing/test_constraints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import glob
from pathlib import Path
from CAD_Sketcher.testing.utils import BgsTestCase

class TestConstraints(BgsTestCase):
def test_constraints(self):
import bpy
path = str(Path(__file__).parent.absolute() / "constraints" / "*.blend")
test_files = glob.glob(path)
for test_file in test_files:
with bpy.data.libraries.load(test_file) as (data_from, data_to):
for attr in dir(data_to):
setattr(data_to, attr, getattr(data_from, attr))
ok = self.context.scene.sketcher.solve(self.context)
self.assertTrue(ok)

0 comments on commit b279b06

Please sign in to comment.