From a4df18decfc7a534a5b02ac0ab572df6be4e771b Mon Sep 17 00:00:00 2001 From: Renaud NEDELEC Date: Tue, 3 Nov 2015 16:04:35 +0100 Subject: [PATCH] [PythonAPI] tests updates --- src/PythonAPI/Test/TestSketcherAddPoint.py | 4 ++++ src/PythonAPI/Test/TestSketcherSetCoincident.py | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) 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 -- 2.39.2