]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI] tests updates
authorRenaud NEDELEC <renaud.nedelec@opencascade.com>
Tue, 3 Nov 2015 15:04:35 +0000 (16:04 +0100)
committerRenaud NEDELEC <renaud.nedelec@opencascade.com>
Tue, 3 Nov 2015 15:04:35 +0000 (16:04 +0100)
src/PythonAPI/Test/TestSketcherAddPoint.py
src/PythonAPI/Test/TestSketcherSetCoincident.py

index 198887b0c57ff48503590a8867173d29fc400842..284d377641ee2c6f425d309e3421d9bea9d953eb 100644 (file)
@@ -16,6 +16,10 @@ class SketcherAddPoint(SketcherTestCase):
         self.assertEqual(point.pointData().x(), 1.0)        
         self.assertEqual(point.pointData().y(), 2.0)
         
+    def test_empty_args(self):
+        with self.assertRaises(TypeError):
+            self.sketch.addPoint()
+        
     
 if __name__ == "__main__":
     unittest.main(verbosity=2)
\ No newline at end of file
index a5c07f7e6a5e6b9d383b47b52f608c5361123cbd..ae07123c87ee92e8b273e1593719af523e8ff96d 100644 (file)
@@ -3,11 +3,21 @@ import model
 from TestSketcher import SketcherTestCase
 
 class SketcherSetCoincident(SketcherTestCase):   
-    def runTest(self):
+    def test_set_coincident(self):
         l1 = self.sketch.addLine(0, 0, 0, 1)
         l2 = self.sketch.addLine(0, 1, 1, 1)
         self.sketch.setCoincident(l1.endPointData(), l2.startPointData())
         model.do()
+    
+    def test_none_type_arguments(self):
+        l2 = self.sketch.addLine(0, 1, 1, 1)
+        with self.assertRaises(TypeError):
+            self.sketch.setCoincident(None, l2.startPointData())
+        
+    def test_empty_arguments(self):
+        l1 = self.sketch.addLine(0, 0, 0, 1)
+        with self.assertRaises(TypeError):
+            self.sketch.setCoincident(l1.endPointData())
 
 if __name__ == "__main__":
-    unittest.main()
\ No newline at end of file
+    unittest.main(verbosity=2)
\ No newline at end of file