Merge pull request #386 from fischman/fischman/speed-up-pack-test

Speed up test_pack.py by `fuse()`ing once per test case.
This commit is contained in:
Roger Maitland 2023-11-15 14:23:21 -05:00 committed by GitHub
commit 3f2c7b460e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

5
.gitignore vendored
View file

@ -37,4 +37,7 @@ env.bak/
venv.bak/
#ide debris
.vscode
.vscode
# Profiling debris.
prof/

View file

@ -40,7 +40,7 @@ class TestPack(unittest.TestCase):
packed = pack(test_boxes, 1)
self.assertEqual(
"bbox: 0.0 <= x <= 94.0, 0.0 <= y <= 86.0, -0.5 <= z <= 0.5",
str(reduce(operator.add, packed, Part()).bounding_box()))
str((Part() + packed).bounding_box()))
def test_random_slots(self):
"""Test pack for 2D objects."""
@ -52,7 +52,7 @@ class TestPack(unittest.TestCase):
packed = pack(inputs, 1)
self.assertEqual(
"bbox: 0.0 <= x <= 124.0, 0.0 <= y <= 105.0, 0.0 <= z <= 0.0",
str(reduce(operator.add, packed, Sketch()).bounding_box()))
str((Sketch() + packed).bounding_box()))
if __name__ == "__main__":
unittest.main()