| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | import Arch |
| | from bimtests import TestArchBase |
| |
|
| |
|
| | class TestArchStairs(TestArchBase.TestArchBase): |
| |
|
| | def test_makeStairs(self): |
| | """Test the makeStairs function.""" |
| | operation = "Testing makeStairs function" |
| | self.printTestMessage(operation) |
| |
|
| | stairs = Arch.makeStairs(length=5000, width=1000, height=3000, steps=10, name="TestStairs") |
| | self.assertIsNotNone(stairs, "makeStairs failed to create a stairs object.") |
| | self.assertEqual(stairs.Label, "TestStairs", "Stairs label is incorrect.") |
| |
|
| | def test_makeRailing(self): |
| | """Test the makeRailing function.""" |
| | operation = "Testing makeRailing..." |
| | self.printTestMessage(operation) |
| |
|
| | stairs = Arch.makeStairs(length=5000, width=1000, height=3000, steps=10, name="TestStairs") |
| | self.assertIsNotNone(stairs, "makeStairs failed to create a stairs object.") |
| |
|
| | |
| | obj = Arch.makeRailing([stairs]) |
| | self.assertIsNotNone(obj, "makeRailing failed to create an object") |
| | self.assertEqual(obj.Label, "Railing", "Incorrect default label for Railing") |
| |
|
| | def test_makeRailing(self): |
| | """Test the makeRailing function.""" |
| | operation = "Testing makeRailing..." |
| | self.printTestMessage(operation) |
| |
|
| | |
| | stairs = Arch.makeStairs(width=800, height=2500, length=3500, steps=14) |
| | self.document.recompute() |
| |
|
| | |
| | pre_creation_names = {obj.Name for obj in self.document.Objects} |
| |
|
| | |
| | Arch.makeRailing([stairs]) |
| | self.document.recompute() |
| |
|
| | |
| | new_railings = [ |
| | obj |
| | for obj in self.document.Objects |
| | if obj.Name not in pre_creation_names |
| | and hasattr(obj, "Proxy") |
| | and getattr(obj.Proxy, "Type", "") == "Pipe" |
| | ] |
| |
|
| | |
| | self.assertEqual(len(new_railings), 2) |
| |
|
| | |
| | for railing in new_railings: |
| | self.assertTrue(hasattr(railing, "Height")) |
| | self.assertTrue(hasattr(railing, "Diameter")) |
| | self.assertTrue(hasattr(railing, "Placement")) |
| |
|