Start and stop server LibreOffice

This commit is contained in:
Mauricio Baeza 2020-12-16 22:31:48 -06:00
parent aef368e8f1
commit 024341caa1
1 changed files with 23 additions and 32 deletions

View File

@ -9,11 +9,11 @@ class BaseTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.server = app.LOServer()
pass
@classmethod
def tearDownClass(cls):
cls.server.stop()
pass
def setUp(self):
msg = f'In method: {self._testMethodName}'
@ -24,12 +24,6 @@ class BaseTest(unittest.TestCase):
pass
# ~ class TestPruebas(BaseTest):
# ~ def test_new_doc(self):
# ~ pass
# ~ class TestDocuments(BaseTest):
# ~ def test_new_doc(self):
@ -44,29 +38,6 @@ class BaseTest(unittest.TestCase):
# ~ result.close()
# ~ class TestTools(BaseTest):
# ~ def test_create_instance_not_exists(self):
# ~ result = app.create_instance('no.exists')
# ~ self.assertIsNone(result)
# ~ def test_create_instance(self):
# ~ result = app.create_instance('com.sun.star.frame.Desktop')
# ~ self.assertIsNotNone(result)
# ~ def test_set_get_config(self):
# ~ expected = 'TEST'
# ~ result = app.set_config('test', 'TEST', 'test')
# ~ self.assertTrue(result)
# ~ result = app.get_config('test', '', 'test')
# ~ self.assertEqual(result, expected)
# ~ def test_msgbox(self):
# ~ expected = 0
# ~ result = app.msgbox('TEST')
# ~ self.assertEqual(result, expected)
class TestVars(BaseTest):
def test_os(self):
@ -118,5 +89,25 @@ class TestVars(BaseTest):
self.assertEqual(result, expected)
class TestTools(BaseTest):
def test_create_instance_not_exists(self):
result = app.create_instance('no.exists.zaz')
self.assertIsNone(result)
def test_create_instance(self):
result = app.create_instance('com.sun.star.frame.Desktop')
self.assertIsNotNone(result)
def test_set_get_config(self):
expected = 'TEST'
result = app.set_config('test', 'TEST', 'test')
self.assertTrue(result)
result = app.get_config('test', '', 'test')
self.assertEqual(result, expected)
if __name__ == '__main__':
unittest.main()
server = app.LOServer()
unittest.main(exit=False)
server.stop()