diff --git a/source/test_easymacro.py b/source/test_easymacro.py index ffcca99..dc91535 100644 --- a/source/test_easymacro.py +++ b/source/test_easymacro.py @@ -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()