From: Renaud NEDELEC Date: Tue, 3 Nov 2015 15:04:35 +0000 (+0100) Subject: [PythonAPI] tests updates X-Git-Tag: V_2.1.0~206^2~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a4df18decfc7a534a5b02ac0ab572df6be4e771b;p=modules%2Fshaper.git [PythonAPI] tests updates --- diff --git a/src/PythonAPI/Test/TestSketcherAddPoint.py b/src/PythonAPI/Test/TestSketcherAddPoint.py index 198887b0c..284d37764 100644 --- a/src/PythonAPI/Test/TestSketcherAddPoint.py +++ b/src/PythonAPI/Test/TestSketcherAddPoint.py @@ -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 diff --git a/src/PythonAPI/Test/TestSketcherSetCoincident.py b/src/PythonAPI/Test/TestSketcherSetCoincident.py index a5c07f7e6..ae07123c8 100644 --- a/src/PythonAPI/Test/TestSketcherSetCoincident.py +++ b/src/PythonAPI/Test/TestSketcherSetCoincident.py @@ -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