diff --git a/src/Mod/Part/CMakeLists.txt b/src/Mod/Part/CMakeLists.txt index 2e0b77a806..3e69359e06 100644 --- a/src/Mod/Part/CMakeLists.txt +++ b/src/Mod/Part/CMakeLists.txt @@ -53,6 +53,7 @@ set(CompoundTools_Scripts set(Part_tests parttests/__init__.py parttests/part_test_objects.py + parttests/regression_tests.py ) add_custom_target(PartScripts ALL SOURCES diff --git a/src/Mod/Part/TestPartApp.py b/src/Mod/Part/TestPartApp.py index 0b4d08ee31..cf88dd1d0a 100644 --- a/src/Mod/Part/TestPartApp.py +++ b/src/Mod/Part/TestPartApp.py @@ -19,11 +19,13 @@ # USA * #************************************************************************** -import FreeCAD, os, sys, unittest, Part +import FreeCAD, unittest, Part import copy from FreeCAD import Units App = FreeCAD +from parttests.regression_tests import RegressionTests + #--------------------------------------------------------------------------- # define the test cases to test the FreeCAD Part module #--------------------------------------------------------------------------- diff --git a/src/Mod/Part/parttests/regression_tests.py b/src/Mod/Part/parttests/regression_tests.py new file mode 100644 index 0000000000..9f6b2e1bdf --- /dev/null +++ b/src/Mod/Part/parttests/regression_tests.py @@ -0,0 +1,22 @@ +from FreeCAD import Vector +import Part + +import unittest + +class RegressionTests(unittest.TestCase): + + @unittest.skip("issue 4456") + def test_issue_4456(self): + """ + 0004456: Regression : Part.Plane.Intersect do not accept plane as argument + """ + p1 = Part.Plane() + p2 = Part.Plane(Vector(0, 0, 0), Vector(1, 0, 0)) + + result = p1.intersect(p2) + line = result.pop() + self.assertEqual(line.Location, Vector(0, 0, 0)) + self.assertEqual(line.Direction, Vector(0, 1, 0)) + # We should now have empty list... + with self.assertRaises(IndexError): + result.pop()