Exemple #1
0
    def macro_runs(self, **kwargs):
        """ Reimplementation of macro_runs method for ls macros.
            It verifies that elements (elem_type) gotten by parsing the
            macro executor log output are in the correspondent
            list (elem_type) of SardanaEnv.
        """
        RunMacroTestCase.macro_runs(self, **kwargs)
        self.log_output = self.macro_executor.getLog("output")
        msg = "generic ls macro does not contain elements"
        self.assertTrue(len(self.log_output) > 0, msg)

        if (self.elem_type is not None):
            list_sardemo = SarDemoEnv().getElements(self.elem_type)
        else:
            raise Exception("element_type cannot be None")

        #parsing log output to get all elements
        header_rows = 2
        names_column_index = 0
        macro_output = []
        for row, in self.log_output[header_rows:]:
            macro_output.append(row.split()[names_column_index])
        # Evaluate if element of A are in B
        if len(macro_output) >= len(list_sardemo):
            self.check_elements(list_sardemo, macro_output)
        else:
            self.check_elements(macro_output, list_sardemo)
Exemple #2
0
    def macro_runs(self, **kwargs):
        """ Reimplementation of macro_runs method for ls macros.
            It verifies that elements (elem_type) gotten by parsing the
            macro executor log output are in the correspondent
            list (elem_type) of SardanaEnv.
        """
        RunMacroTestCase.macro_runs(self, **kwargs)
        self.log_output = self.macro_executor.getLog("output")
        msg = "generic ls macro does not contain elements"
        self.assertTrue(len(self.log_output) > 0, msg)

        if (self.elem_type is not None):
            list_sardemo = SarDemoEnv().getElements(self.elem_type)
        else:
            raise Exception("element_type cannot be None")

        # parsing log output to get all elements
        header_rows = 2
        names_column_index = 0
        macro_output = []
        for row, in self.log_output[header_rows:]:
            macro_output.append(row.split()[names_column_index])
        # Evaluate if element of A are in B
        if len(macro_output) >= len(list_sardemo):
            self.check_elements(list_sardemo, macro_output)
        else:
            self.check_elements(macro_output, list_sardemo)
Exemple #3
0
 def macro_runs(self, **kw):
     """Testing the execution of the 'wm' macro and verify that the log
     'output' exists.
     """
     RunMacroTestCase.macro_runs(self, **kw)
     self.logOutput = self.macro_executor.getLog("output")
     msg = "wm macro did not return any data."
     self.assertTrue(len(self.logOutput) > 0, msg)
Exemple #4
0
 def macro_runs(self, **kw):
     """Testing the execution of the 'wm' macro and verify that the log
     'output' exists.
     """
     RunMacroTestCase.macro_runs(self, **kw)
     self.logOutput = self.macro_executor.getLog("output")
     msg = "wm macro did not return any data."
     self.assertTrue(len(self.logOutput) > 0, msg)
Exemple #5
0
 def setUp(self):
     macros_test_path = '../../test/res/macros'
     source = os.path.join(os.path.dirname(__file__), macros_test_path)
     path = os.path.abspath(source)
     properties = {'MacroPath': [path]}
     unittest.TestCase.setUp(self)
     BaseMacroServerTestCase.setUp(self, properties)
     RunMacroTestCase.setUp(self)
Exemple #6
0
 def setUp(self):
     macros_test_path = '../../test/res/macros'
     source = os.path.join(os.path.dirname(__file__), macros_test_path)
     path = os.path.abspath(source)
     properties = {'MacroPath': [path]}
     unittest.TestCase.setUp(self)
     BaseMacroServerTestCase.setUp(self, properties)
     RunMacroTestCase.setUp(self)
Exemple #7
0
 def tearDown(self):
     unittest.TestCase.tearDown(self)
     RunMacroTestCase.tearDown(self)
     BaseMacroServerTestCase.tearDown(self)
     MeasSarTestTestCase.tearDown(self)
Exemple #8
0
 def setUp(self):
     MeasSarTestTestCase.setUp(self)
     BaseMacroServerTestCase.setUp(self)
     RunMacroTestCase.setUp(self)
     unittest.TestCase.setUp(self)
Exemple #9
0
 def tearDown(self):
     unittest.TestCase.tearDown(self)
     RunMacroTestCase.tearDown(self)
     BaseMacroServerTestCase.tearDown(self)
     MeasSarTestTestCase.tearDown(self)
Exemple #10
0
 def setUp(self):
     MeasSarTestTestCase.setUp(self)
     BaseMacroServerTestCase.setUp(self)
     RunMacroTestCase.setUp(self)
     unittest.TestCase.setUp(self)
Exemple #11
0
 def tearDown(self):
     RunMacroTestCase.tearDown(self)
     BaseMacroServerTestCase.tearDown(self)
     unittest.TestCase.tearDown(self)
Exemple #12
0
 def tearDown(self):
     BaseMacroServerTestCase.tearDown(self)
     RunMacroTestCase.tearDown(self)
     unittest.TestCase.tearDown(self)