6 class PointTestCase(unittest.TestCase):
9 self.session = ModelAPI.ModelAPI_Session.get()
10 self.doc = self.session.moduleDocument()
11 self.session.startOperation()
12 self.feature = self.doc.addFeature("Point")
13 self.feature.execute()
14 self.session.finishOperation()
17 self.session.closeAll()
19 def test_ConstructorWithValues(self):
20 point = ConstructionAPI.ConstructionAPI_Point(self.feature, 10, "20", "x + 30")
21 self.assertEqual(10, point.x().value())
22 self.assertEqual("20", point.y().text())
23 self.assertEqual("x + 30", point.z().text())
25 def test_setValue(self):
26 point = ConstructionAPI.ConstructionAPI_Point(self.feature)
27 self.assertEqual(0, point.x().value())
28 self.assertEqual(0, point.y().value())
29 self.assertEqual(0, point.z().value())
31 point.setPoint(10, "20", "x + 30")
32 self.assertEqual(10, point.x().value())
33 self.assertEqual("20", point.y().text())
34 self.assertEqual("x + 30", point.z().text())
36 if __name__ == "__main__":