]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix tests using unittest (failed cases were not reported by ctest).
authormzn <mzn@opencascade.com>
Mon, 1 Oct 2018 06:06:06 +0000 (09:06 +0300)
committermzn <mzn@opencascade.com>
Mon, 1 Oct 2018 06:07:31 +0000 (09:07 +0300)
39 files changed:
src/ConstructionAPI/Test/TestAxis.py
src/ConstructionAPI/Test/TestPoint.py
src/ExchangeAPI/Test/TestExchange.py
src/ModelHighAPI/Test/TestDouble.py
src/ModelHighAPI/Test/TestInteger.py
src/ModelHighAPI/Test/TestRefAttr.py
src/ModelHighAPI/Test/TestReference.py
src/ParametersPlugin/Test/TestParameterChangeValue.py
src/ParametersPlugin/Test/TestParameterRename.py
src/PythonAPI/Test/TestFeatures.py
src/PythonAPI/Test/TestFeaturesExtrusion.py
src/PythonAPI/Test/TestFeaturesRevolution.py
src/PythonAPI/Test/TestMakeBrick1.py
src/PythonAPI/Test/TestMakeBrick2.py
src/PythonAPI/Test/TestModel.py
src/PythonAPI/Test/TestPlatine.py
src/PythonAPI/Test/TestPrimitivesBox.py
src/PythonAPI/Test/TestPythonAPI.py
src/PythonAPI/Test/TestSketcherAddArc.py
src/PythonAPI/Test/TestSketcherAddCircle.py
src/PythonAPI/Test/TestSketcherAddLine.py
src/PythonAPI/Test/TestSketcherAddPoint.py
src/PythonAPI/Test/TestSketcherSetAngle.py
src/PythonAPI/Test/TestSketcherSetCoincident.py
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/TestSketcherSetTangent.py
src/PythonAPI/Test/TestSketcherSetVertical.py
src/SketchAPI/Test/TestSketch.py
src/SketchPlugin/Test/TestConstraintCollinear.py
src/SketchPlugin/Test/TestFilletInteracting.py
src/SketchPlugin/Test/TestMoveArc.py
src/SketchPlugin/Test/TestMoveCircle.py
src/SketchPlugin/Test/TestMoveLine.py
src/SketchPlugin/Test/TestMovePoint.py

index 995577136490c12f31ed28b1bdc6e7862fcd9b7a..b2764e57394cf520c6eb663e967957171b42c838 100644 (file)
@@ -45,4 +45,5 @@ class AxisTestCase(unittest.TestCase):
         self.assertEqual(100,axis.zDimension().value())
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 185859540962ca8e287bd1245fef8758cafbd96f..572e78ab81d8bdd88e2ec4f09649aa880423db7a 100644 (file)
@@ -55,4 +55,5 @@ class PointTestCase(unittest.TestCase):
         self.assertEqual("x + 30", point.z().text())
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 94c731faf8a22553bd1beac46d23306ff9d9a82e..06e294a5c2bafd69d2ef84e7106596b6094d4767 100644 (file)
@@ -47,4 +47,5 @@ class ExchangeTestCase(unittest.TestCase):
         self.session.finishOperation()
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 438444b028c84f4d7c38625141c22660eb2fa222..00a50f4f52656265733d90793ca8c939a846f2e6 100644 (file)
@@ -35,4 +35,5 @@ class DoubleTestCase(unittest.TestCase):
 
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 26ac7cf62b5488d9c8674a8bad518d840cc9dc8c..e27aea8def3643c95be9268e7721e51dc765f2d3 100644 (file)
@@ -35,4 +35,5 @@ class IntegerTestCase(unittest.TestCase):
 
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 7706e4a162e75e339b27acb609dd34668caad2ab..56ed4716f660591d0df1f08ac99fdf9502470a74 100644 (file)
@@ -56,4 +56,5 @@ class RefAttrTestCase(FeaturesFixture):
 
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 4345833038a3e34fa504efa8f4a2eb8594e46028..976872031f481fd7d430d70f2270a83830a678b4 100644 (file)
@@ -52,4 +52,5 @@ class RefAttrTestCase(FeaturesFixture):
 
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 2da87e4e62c87f4891f28078928a152b207a9d6b..3f9a8bf56e18d61d11a7bb1b4ff97652ebaa55fe 100644 (file)
@@ -175,8 +175,9 @@ class TestParameterRename(unittest.TestCase):
         self.assertEqual(self.anCircleCentr.y(), 220.)
         self.assertEqual(self.aRadiusAttr.value(), 200.)
 
-if __name__ == '__main__':
-    unittest.main(exit=False)
+if __name__ == "__main__":
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
 #=========================================================================
 # End of test
 #=========================================================================
index c4ba99239cf202f29d0236a74cb6f4d483cbac91..703ee35d1a39e2d0ba9ef4e41e3c61a5396b9fd2 100644 (file)
@@ -230,8 +230,9 @@ class TestParameterRename(unittest.TestCase):
         self.assertEqual(self.anCircleCentr.y(), 170.)
         self.assertEqual(self.aRadiusAttr.value(), 150.)
 
-if __name__ == '__main__':
-    unittest.main(exit=False)
+if __name__ == "__main__":
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
 #=========================================================================
 # End of test
 #=========================================================================
index f70dc035584a1f8b3ce97076d01090a1f1bd8aab..8c30d92faa90147d6ae7888562c406d94560e502 100644 (file)
@@ -111,4 +111,5 @@ class FeaturesTestCase(FeaturesFixture):
 #-----------------------------------------------------------------------------
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index e5f08c70f46663569ee67f609489ab4a5775f529..45ee4fec3d3d4337da54f878333ee73c1ec61539 100644 (file)
@@ -173,4 +173,5 @@ class FeaturesExtrusionTestCase(FeaturesExtrusionFixture):
 
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 37a69b386b3a99a84db0d85b0ada24f8288c5dda..9b24e95505456ad3c546e086e3747e4011e08789 100644 (file)
@@ -206,4 +206,5 @@ class FeaturesRevolutionTestCase(FeaturesRevolutionFixture):
 
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index b5bd7bfef106a1491bd020f7a3545d7776c45c5c..5e1aa538763c5e96a8e6213aedf51e95edded880 100644 (file)
@@ -23,4 +23,5 @@ import unittest
 import salome.shaper.examples.MakeBrick1
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index cc681ff094d91ec4b8b50e75af75059482f7d57e..27f353d8ff6d28ee070ceb4d46f10e754fea6d58 100644 (file)
@@ -23,4 +23,5 @@ import unittest
 import salome.shaper.examples.MakeBrick2
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 5317eeb87db3899ba33333b94e29318b05492f0c..8059037ae2e316f6eeeb978dee9a6381bf00386c 100644 (file)
@@ -36,4 +36,5 @@ class ModelTestCase(unittest.TestCase):
         model.addSketch(self.part, plane)
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index dd5b4989049433a0ee4318f11145c1f6f923bf04..4ac0320eed4aad769730e130df8250e14c841514 100644 (file)
@@ -23,4 +23,5 @@ import unittest
 import salome.shaper.examples.Platine
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index c679406702821bcb9f5a0d08225a38130512a3d0..81dfe1445867a2554da3107d7042a4d556a4bece 100644 (file)
@@ -60,4 +60,5 @@ class PrimitivesAddBoxTestCase(PrimitivesAddBox):
         self.assertEqual(box.secondPoint().context().shape().isVertex(),True)
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index fadc37be7c0be23832ea18db718c82457f9b16c2..4919ddcd397532244ecd76dfdbb3b286e6bf6e2f 100644 (file)
@@ -23,4 +23,5 @@ from salome.shaper import model
 from salome.shaper import geom
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 1c3d2278f5c1c82ea14cd7550e66fbadc5b78d3c..7ea8f262de9970a7c23c5818fb3fc7bdd6cc6366 100644 (file)
@@ -55,4 +55,5 @@ class SketcherAddArc(SketcherTestCase):
 
 
 if __name__ == "__main__":
-    unittest.main(verbosity=2, exit=False)
+    test_program = unittest.main(verbosity=2, exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 13ac042022733652ed66d2b898ebd41a46a258e9..b1af039f0f57069612688123f00481be35d91d3a 100644 (file)
@@ -42,4 +42,5 @@ class SketcherAddCircle(SketcherTestCase):
 
 
 if __name__ == "__main__":
-    unittest.main(verbosity=2, exit=False)
+    test_program = unittest.main(verbosity=2, exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index e5b021bf778f71ea9a9a67fb8c8dcd10f246b5f9..46aad38f292e56be466661be941ffd36a857208c 100644 (file)
@@ -41,4 +41,5 @@ class SketcherAddLine(SketcherTestCase):
 
 
 if __name__ == "__main__":
-    unittest.main(verbosity=2, exit=False)
\ No newline at end of file
+    test_program = unittest.main(verbosity=2, exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index ce6a59a2025a95689222ec87a8ca1575d1606a0c..1a64f4d9407fa7fc0fdb6510c22308f83595aca1 100644 (file)
@@ -37,4 +37,5 @@ class SketcherAddPoint(SketcherTestCase):
         self.assertEqual(point.coordinates().y(), 2.0)
 
 if __name__ == "__main__":
-    unittest.main(verbosity=2, exit=False)
\ No newline at end of file
+    test_program = unittest.main(verbosity=2, exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index 80341e3694709be91add7d9159bba8efba6388cc..f4c914c5cbdaca69d94c459c7912a4cdc59e9055 100644 (file)
@@ -51,4 +51,5 @@ class SketcherSetAngle(SketcherTestCase):
             )
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
\ No newline at end of file
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index 4ceda389494adada7b1292fae84a67e269694fa4..b5f6131708c8cbef3617b7ee2d2b5100d4e01a2e 100644 (file)
@@ -40,4 +40,5 @@ class SketcherSetCoincident(SketcherTestCase):
             self.sketch.setCoincident(l1.endPoint())
 
 if __name__ == "__main__":
-    unittest.main(verbosity=2, exit=False)
\ No newline at end of file
+    test_program = unittest.main(verbosity=2, exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index 52f9e63360dea856b783a9612b50d68528d8af70..085b6db611a6238fd809b7a93f072cb486966d8a 100644 (file)
@@ -38,4 +38,5 @@ class SketcherSetFillet(SketcherTestCase):
         model.do()
 
 if __name__ == "__main__":
-    unittest.main(verbosity=2, exit=False)
\ No newline at end of file
+    test_program = unittest.main(verbosity=2, exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index e5c40aef505a5c6aa99e13e587f60638dd847d2b..a8d6f8cbf5b0d9d47389b2860402f8884fc3d07c 100644 (file)
@@ -30,4 +30,5 @@ class SketcherSetHorizontal(SketcherTestCase):
         self.assertEqual(line.startPoint().y(), line.endPoint().y())
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
\ No newline at end of file
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index 233f677b540dce73716dce29eb9c7b270af97f7c..5230bd64a4518490d7691562dbef0189a8a21e4f 100644 (file)
@@ -39,4 +39,5 @@ class SketcherSetLength(SketcherTestCase):
         self.assertAlmostEqual(length, 25.0, delta=TestSketcher.DELTA)
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
\ No newline at end of file
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index 99b78e150b943e554bab22c1e09874a59a8b48df..90fe226751c1851f2000fc99c22ac95f1ca64c5e 100644 (file)
@@ -30,4 +30,5 @@ class SketcherSetParallel(SketcherTestCase):
         model.do()
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
\ No newline at end of file
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index b702cb563956bec1d915d3938b64deef33acfa65..8486ae141cb6ef42cda3dcef533896fa8bc81b24 100644 (file)
@@ -38,4 +38,5 @@ class SketcherSetPerpendicular(SketcherTestCase):
         self.assertAlmostEqual(dot_product, 0.0, delta=TestSketcher.DELTA)
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
\ No newline at end of file
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index 37f9540fc26e7f3a548780439245eb31aed7afad..df233b0c4c7208b559c3add2343c06e1f12af9c2 100644 (file)
@@ -38,4 +38,5 @@ class SketcherSetRadius(SketcherTestCase):
         self.assertEqual(circle.radius().value(), 25.0)
 
 if __name__ == "__main__":
-    unittest.main(verbosity=2, exit=False)
\ No newline at end of file
+    test_program = unittest.main(verbosity=2, exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index 127b070ec5f9c9b9c5d8a6f4d34c520a261edb21..18badffd7cc10bbf5ab1307e42657442cebffd57 100644 (file)
@@ -41,4 +41,5 @@ class SketcherSetTangent(SketcherTestCase):
             self.sketch.setTangent(None, self.arc)
 
 if __name__ == "__main__":
-    unittest.main(verbosity=2, exit=False)
\ No newline at end of file
+    test_program = unittest.main(verbosity=2, exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index 76926b3dc63e78a5348dfbdd44e3b2bc20227019..d040e5a8cea6f648acfebd9bda37ab6226fc6c26 100644 (file)
@@ -30,4 +30,5 @@ class SketcherSetVertical(SketcherTestCase):
         self.assertEqual(line.startPoint().x(), line.endPoint().x())
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
\ No newline at end of file
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
\ No newline at end of file
index c5cbfa8651486b75922da017ce3cf454a6c1a620..fb7c3c0196b4c0d89b1877aa1a459c6aef55358a 100644 (file)
@@ -35,4 +35,5 @@ class SketchTestCase(unittest.TestCase):
 # TODO(spo): add tests.
 
 if __name__ == "__main__":
-    unittest.main(exit=False)
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 6f3d2dac5d4ccb72d9d8f3856efdd1dd81787a5f..17cb5cb25f65ceded0396d1078da00885bc56ebf 100644 (file)
@@ -185,8 +185,9 @@ class TestConstraintCollinear(unittest.TestCase):
     model.do()
     self.assertEqual(model.dof(self.mySketch), self.myDOF)
 
-if __name__ == '__main__':
-  unittest.main(exit=False)
+if __name__ == "__main__":
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
 #=========================================================================
 # End of test
 #=========================================================================
index 9eac72b0e4b476e923861c11b82df48710a63e84..e1957462290a817e3f397ad19476385531951d6e 100644 (file)
@@ -632,5 +632,6 @@ class TestFilletInteracting(unittest.TestCase):
     model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
 
 
-if __name__ == '__main__':
-  unittest.main(exit=False)
+if __name__ == "__main__":
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index e9f5f73b427c754e73aac05ae0de8a4f4c7a9dfe..ad78cc063528c99a5259ed148fe54ae8ee1e2b62 100644 (file)
@@ -345,5 +345,6 @@ class TestMoveArc(unittest.TestCase):
     self.checkPointCoordinates(self.myArc.endPoint(), self.myEnd)
 
 
-if __name__ == '__main__':
-  unittest.main(exit=False)
+if __name__ == "__main__":
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index c0ded8ac0683555f0dbe8c9994b39f4a521e2c8a..61db0c56c338a6755bc6214b4e34cbea20ff2982 100644 (file)
@@ -145,5 +145,6 @@ class TestMoveCircle(unittest.TestCase):
     self.assertAlmostEqual(self.myCircle.radius().value(), self.myRadius)
 
 
-if __name__ == '__main__':
-  unittest.main(exit=False)
+if __name__ == "__main__":
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index fe63ee0f60bd39324643f30b3d0b0b98ea16fb10..d893559f17f0d1fddc5424ef11f7b412f8f6b3d0 100644 (file)
@@ -132,5 +132,6 @@ class TestMoveLine(unittest.TestCase):
     self.checkPointCoordinates(self.myLine.endPoint(), self.myEnd)
 
 
-if __name__ == '__main__':
-  unittest.main(exit=False)
+if __name__ == "__main__":
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"
index 2638be12b0156184ab61586892a147a450545ead..5616bd91177b2f02315ef00ae26bd3d48aeae6aa 100644 (file)
@@ -104,5 +104,6 @@ class TestMovePoint(unittest.TestCase):
     self.assertAlmostEqual(self.myPointCoordinates.y(), coord[1])
 
 
-if __name__ == '__main__':
-  unittest.main(exit=False)
+if __name__ == "__main__":
+    test_program = unittest.main(exit=False)
+    assert test_program.result.wasSuccessful(), "Test failed"