Salome HOME
Issue #1648: Dump Python in the High Level Parameterized Geometry API
[modules/shaper.git] / src / ExchangeAPI / Test / TestExchange.py
1 import unittest
2
3 import ModelAPI
4 import ExchangeAPI
5 import model
6
7 class ExchangeTestCase(unittest.TestCase):
8
9     def setUp(self):
10         self.session = ModelAPI.ModelAPI_Session.get()
11         self.doc = self.session.moduleDocument()
12
13     def tearDown(self):
14         # assert(model.checkPythonDump())
15         # This test just checks interface of Exchange High API
16         # Export feature stays in the tree because it's invalid, but after dump it is not in the tree.
17         self.session.closeAll()
18
19     def test_addImport(self):
20         self.session.startOperation()
21         self.feature = ExchangeAPI.addImport(self.doc, "file_path")
22         self.session.finishOperation()
23
24     def test_addExport(self):
25         self.session.startOperation()
26         self.feature = ExchangeAPI.exportToFile(self.doc, "file_path", [], "file_format")
27         self.session.finishOperation()
28
29 if __name__ == "__main__":
30     unittest.main()