]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Generated functions get*() for Interface returns attrubutes.
authorspo <sergey.pokhodenko@opencascade.com>
Mon, 26 Oct 2015 07:20:24 +0000 (10:20 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Mon, 26 Oct 2015 07:20:24 +0000 (10:20 +0300)
src/PythonAPI/Test/TestFeaturesExtrusion.py
src/PythonAPI/model/roots.py

index 2a6b07c116bef1db9aded2b02ba3d70883d3bca2..7ef748cd351a5c80d9c87db24e22cd57f4b6c9ae 100644 (file)
@@ -53,13 +53,13 @@ class FeaturesAddExtrusionTestCase(FeaturesAddExtrusionFixture):
                                        sketch.selectFace(circle.result()),
                                        10, 0)
 
-        self.assertEqual(extrusion.getCreationMethod(), "BySizes")
-        self.assertEqual(extrusion.getToSize(), 10)
-        self.assertEqual(extrusion.getFromSize(), 0)
+        self.assertEqual(extrusion.getCreationMethod().value(), "BySizes")
+        self.assertEqual(extrusion.getToSize().value(), 10)
+        self.assertEqual(extrusion.getFromSize().value(), 0)
         self.assertEqual(extrusion.getToObject().context(), None)
-        self.assertEqual(extrusion.getToOffset(), 0)
+        self.assertEqual(extrusion.getToOffset().value(), 0)
         self.assertEqual(extrusion.getFromObject().context(), None)
-        self.assertEqual(extrusion.getFromOffset(), 0)
+        self.assertEqual(extrusion.getFromOffset().value(), 0)
 
     def test_add_extrusion_by_face_and_planes(self):
         # base
@@ -84,15 +84,15 @@ class FeaturesAddExtrusionTestCase(FeaturesAddExtrusionFixture):
                                        to_sketch, 15,
                                        from_sketch, 20)
 
-        self.assertEqual(extrusion.getCreationMethod(), "ByPlanesAndOffsets")
-        self.assertEqual(extrusion.getToSize(), 0)
-        self.assertEqual(extrusion.getFromSize(), 0)
+        self.assertEqual(extrusion.getCreationMethod().value(), "ByPlanesAndOffsets")
+        self.assertEqual(extrusion.getToSize().value(), 0)
+        self.assertEqual(extrusion.getFromSize().value(), 0)
 #         self.assertEqual(extrusion.getToObject().context(),
 #                          to_sketch.result())
-        self.assertEqual(extrusion.getToOffset(), 15)
+        self.assertEqual(extrusion.getToOffset().value(), 15)
 #         self.assertEqual(extrusion.getFromObject().context(),
 #                          from_sketch.result())
-        self.assertEqual(extrusion.getFromOffset(), 20)
+        self.assertEqual(extrusion.getFromOffset().value(), 20)
 
 
 class FeaturesExtrusionTestCase(FeaturesExtrusionFixture):
@@ -106,25 +106,29 @@ class FeaturesExtrusionTestCase(FeaturesExtrusionFixture):
         self.assertTrue(isinstance(self.extrusion.getBase(),
                                    ModelAPI.ModelAPI_AttributeSelectionList))
         self.assertTrue(isinstance(self.extrusion.getCreationMethod(),
-                                   basestring))
-        self.assertTrue(isinstance(self.extrusion.getToSize(), float))
-        self.assertTrue(isinstance(self.extrusion.getFromSize(), float))
+                                   ModelAPI.ModelAPI_AttributeString))
+        self.assertTrue(isinstance(self.extrusion.getToSize(),
+                                   ModelAPI.ModelAPI_AttributeDouble))
+        self.assertTrue(isinstance(self.extrusion.getFromSize(),
+                                   ModelAPI.ModelAPI_AttributeDouble))
         self.assertTrue(isinstance(self.extrusion.getToObject(),
                                    ModelAPI.ModelAPI_AttributeSelection))
-        self.assertTrue(isinstance(self.extrusion.getToOffset(), float))
+        self.assertTrue(isinstance(self.extrusion.getToOffset(),
+                                   ModelAPI.ModelAPI_AttributeDouble))
         self.assertTrue(isinstance(self.extrusion.getFromObject(),
                                    ModelAPI.ModelAPI_AttributeSelection))
-        self.assertTrue(isinstance(self.extrusion.getFromOffset(), float))
+        self.assertTrue(isinstance(self.extrusion.getFromOffset(),
+                                   ModelAPI.ModelAPI_AttributeDouble))
 
     def test_extrusion_set_sizes(self):
         self.extrusion.setSize(15, 20)
-        self.assertEqual(self.extrusion.getCreationMethod(), "BySizes")
-        self.assertEqual(self.extrusion.getToSize(), 15)
-        self.assertEqual(self.extrusion.getFromSize(), 20)
+        self.assertEqual(self.extrusion.getCreationMethod().value(), "BySizes")
+        self.assertEqual(self.extrusion.getToSize().value(), 15)
+        self.assertEqual(self.extrusion.getFromSize().value(), 20)
         self.assertEqual(self.extrusion.getToObject().context(), None)
-        self.assertEqual(self.extrusion.getToOffset(), 0)
+        self.assertEqual(self.extrusion.getToOffset().value(), 0)
         self.assertEqual(self.extrusion.getFromObject().context(), None)
-        self.assertEqual(self.extrusion.getFromOffset(), 0)
+        self.assertEqual(self.extrusion.getFromOffset().value(), 0)
 
     def test_extrusion_set_planes_and_offsets(self):
         # base
index 0cf8ae2740fe8425cbb6d61a533a61e820f7b795..c2c70cbfab62258926db7ab7546dda6bad802c7a 100644 (file)
@@ -48,7 +48,7 @@ class Interface():
             for possible_name in possible_names:
                 if hasattr(self, possible_name):
                     def getter():
-                        return get_value(getattr(self, possible_name))
+                        return getattr(self, possible_name)
                     return getter
 
         return self._feature.__getattribute__(name)