]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix tests for constraints Fillet, Horizontal, Length, Parallel, Perpendicular, Rigid...
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 15 Jun 2016 08:55:14 +0000 (11:55 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 11:41:09 +0000 (14:41 +0300)
src/PythonAPI/Test/TestSketcherSetFillet.py
src/PythonAPI/Test/TestSketcherSetHorizontal.py
src/PythonAPI/Test/TestSketcherSetLength.py
src/PythonAPI/Test/TestSketcherSetParallel.py
src/PythonAPI/Test/TestSketcherSetPerpendicular.py
src/PythonAPI/Test/TestSketcherSetRadius.py
src/PythonAPI/Test/TestSketcherSetRigid.py
src/PythonAPI/Test/TestSketcherSetVertical.py

index fc5211b36d4b64cc01f571bc690ff2b58aadb6de..95b3d39981451ecc38dca5aa0cbfcde811f8e97f 100644 (file)
@@ -2,12 +2,12 @@ import unittest
 import model
 from TestSketcher import SketcherTestCase
 
-class SketcherSetFillet(SketcherTestCase):   
+class SketcherSetFillet(SketcherTestCase):
     def runTest(self):
         l1 = self.sketch.addLine(0, 0, 0, 1)
         l2 = self.sketch.addLine(0, 1, 1, 1)
         self.sketch.setCoincident(l1.endPoint(), l2.startPoint())
-        self.sketch.setFillet(l1.endPoint(), 10.0)
+        self.sketch.setFillet([l1.endPoint()], 10.0)
         model.do()
 
 if __name__ == "__main__":
index 1f0ee545c84c4ee82fbd63f9e72ec1a6783e7155..68f23d35239befccaad9576426523648fa03f420 100644 (file)
@@ -2,10 +2,10 @@ import unittest
 import model
 from TestSketcher import SketcherTestCase
 
-class SketcherSetHorizontal(SketcherTestCase):   
+class SketcherSetHorizontal(SketcherTestCase):
     def runTest(self):
         line = self.sketch.addLine(0, 0, 1, 1)
-        self.sketch.setHorizontal(line.result())
+        self.sketch.setHorizontal(line)
         model.do()
         self.assertEqual(line.startPoint().y(), line.endPoint().y())
 
index bbbcab6dd90452e3b04a8522b7e9b48d1a6c662f..6a4997c80b931299af4844a154ae050ba3fa1b4f 100644 (file)
@@ -4,11 +4,11 @@ import math
 import TestSketcher
 from TestSketcher import SketcherTestCase
 
-class SketcherSetLength(SketcherTestCase):   
+class SketcherSetLength(SketcherTestCase):
     def runTest(self):
         # Set the constraint
         line = self.sketch.addLine(0, 0, 0, 1)
-        self.sketch.setLength(line.result(), 25.0)
+        self.sketch.setLength(line, 25.0)
         # Commit the transaction
         model.do()
         # Check the result
@@ -17,6 +17,6 @@ class SketcherSetLength(SketcherTestCase):
             math.pow((line.endPoint().y() - line.startPoint().y()), 2)
             )
         self.assertAlmostEqual(length, 25.0, delta=TestSketcher.DELTA)
-        
+
 if __name__ == "__main__":
     unittest.main()
\ No newline at end of file
index 75c37ecc37eef625b5134ceb771959ce2197dc6b..9e440ab32cd6bd816eaab47a1d29b7a65a491e1c 100644 (file)
@@ -2,11 +2,11 @@ import unittest
 import model
 from TestSketcher import SketcherTestCase
 
-class SketcherSetParallel(SketcherTestCase):   
+class SketcherSetParallel(SketcherTestCase):
     def runTest(self):
         l1 = self.sketch.addLine(0, 0, 0, 1)
         l2 = self.sketch.addLine(0, 1, 1, 1)
-        self.sketch.setParallel(l1.result(), l2.result())
+        self.sketch.setParallel(l1, l2)
         model.do()
 
 if __name__ == "__main__":
index 766fc5057a758cb3d360a9da75b2f4e5978ff6f0..cc4e3e795cd0feca58b54c9432ccba39fce6256d 100644 (file)
@@ -8,9 +8,9 @@ class SketcherSetPerpendicular(SketcherTestCase):
     def runTest(self):
         l1 = self.sketch.addLine(0, 0, 0, 1)
         l2 = self.sketch.addLine(0, 0, 1, 1)
-        self.sketch.setPerpendicular(l1.result(), l2.result())
+        self.sketch.setPerpendicular(l1, l2)
         model.do()
-        
+
         dot_product = (l1.endPoint().x() - l1.startPoint().x()) * \
                       (l2.endPoint().x() - l2.startPoint().x()) + \
                       (l1.endPoint().y() - l1.startPoint().y()) * \
index 0cb6ad9a072c009f912dfc2ac960326ab8c76612..7f40c547b5b550248ac10c6091cb96c99fae79f9 100644 (file)
@@ -2,13 +2,13 @@ import unittest
 import model
 from TestSketcher import SketcherTestCase
 
-class SketcherSetRadius(SketcherTestCase):   
+class SketcherSetRadius(SketcherTestCase):
     def test_set_radius(self):
         circle = self.sketch.addCircle(0, 10, 20)
         self.sketch.setRadius(circle.result(), 30)
         model.do()
         self.assertEqual(circle.radius(), 30.0)
-        
+
     def test_modify_radius(self):
         circle = self.sketch.addCircle(0, 10, 20)
         radius_constraint = self.sketch.setRadius(circle.result(), 30)
@@ -16,6 +16,6 @@ class SketcherSetRadius(SketcherTestCase):
         self.sketch.setValue(radius_constraint, 20)
         model.do()
         self.assertEqual(circle.radius(), 20.0)
-        
+
 if __name__ == "__main__":
     unittest.main(verbosity=2)
\ No newline at end of file
index 12e946f0330d5533344c635fa5132fa9dcbfe95c..f47c10adb195bc7b185a6bd18637d9993831b9c4 100644 (file)
@@ -5,7 +5,7 @@ from TestSketcher import SketcherTestCase
 class SketcherSetRigid(SketcherTestCase):
     def runTest(self):
         circle = self.sketch.addCircle(0, 10, 20)
-        self.sketch.setRigid(circle.result())
+        self.sketch.setRigid(circle)
         model.do()
         circle.setCenter(0, 0)
         model.do()
index 5128c5b6b1063c37edb717cf05684ea3c6202c2e..3a4be24888053336b4c22806f3e433594bbf69c7 100644 (file)
@@ -2,10 +2,10 @@ import unittest
 import model
 from TestSketcher import SketcherTestCase
 
-class SketcherSetVertical(SketcherTestCase):   
+class SketcherSetVertical(SketcherTestCase):
     def runTest(self):
         line = self.sketch.addLine(0, 0, 1, 1)
-        self.sketch.setVertical(line.result())
+        self.sketch.setVertical(line)
         model.do()
         self.assertEqual(line.startPoint().x(), line.endPoint().x())