Part: Add regression test for issue #4456 (skipped for now)

This commit is contained in:
Priit Laes
2020-10-14 20:52:04 +03:00
committed by wwmayer
parent 1062b6ee0f
commit bbbf7aad16
3 changed files with 26 additions and 1 deletions

View File

@@ -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

View File

@@ -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
#---------------------------------------------------------------------------

View File

@@ -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()