Esempio n. 1
0
 def setUpClass(cls):
     ctrl = datafilereader.construct_chief_controller(datafilereader.ARGUMENTS_PATH)
     cls.testsuite = datafilereader.get_ctrl_by_name('Suite', ctrl.datafiles)
     cls.test = cls.testsuite.tests[0]
     cls.keyword1 = [kw for kw in cls.testsuite.keywords if kw.name == 'KW1'][0]
     cls.keyword2 = [kw for kw in cls.testsuite.keywords if kw.name == 'KW2'][0]
     cls.keyword3 = [kw for kw in cls.testsuite.keywords if kw.name == 'KW3'][0]
Esempio n. 2
0
 def setUpClass(cls):
     ctrl = datafilereader.construct_chief_controller(datafilereader.ARGUMENTS_PATH)
     cls.testsuite = datafilereader.get_ctrl_by_name('Suite', ctrl.datafiles)
     cls.test = cls.testsuite.tests[0]
     keyword = lambda name: [kw for kw in cls.testsuite.keywords if kw.name == name][0]
     cls.keyword1 = keyword('KW1')
     cls.keyword2 = keyword('KW2')
     cls.keyword3 = keyword('KW3')
     cls.keyword4 = keyword('KW4')
Esempio n. 3
0
 def setUp(self):
     self.res_path = datafilereader.OCCURRENCES_PATH
     self.res_name = "new_resource_for_test_creating_and_importing_resource.txt"
     self.res_full_name = os.path.join(self.res_path, self.res_name)
     self.new_keyword_name = "My Keywordian"
     self.ctrl = datafilereader.construct_chief_controller(datafilereader.OCCURRENCES_PATH)
     self.suite = datafilereader.get_ctrl_by_name("TestSuite1", self.ctrl.datafiles)
     self.test = self.suite.tests[0]
     self.test.execute(ChangeCellValue(0, 0, self.new_keyword_name))
     self.test.execute(ChangeCellValue(0, 1, "value"))
Esempio n. 4
0
 def setUpClass(cls):
     chief = datafilereader.construct_chief_controller(datafilereader.FINDWHEREUSED_VARIABLES_PATH)
     cls._suite1 = _get_ctrl_by_name(cls, "Suite 1", chief.datafiles)
     cls._suite2 = _get_ctrl_by_name(cls, "Suite 2", chief.datafiles)
     cls._resource1 = _get_ctrl_by_name(cls, "Res1", chief.datafiles)
     cls._case1 = _get_ctrl_by_name(cls, "Case 1", chief.datafiles)
     cls._case2 = _get_ctrl_by_name(cls, "Case 2", chief.datafiles)
     cls._case3 = _get_ctrl_by_name(cls, "Case 3", chief.datafiles)
     cls._case4 = _get_ctrl_by_name(cls, "Case 4", chief.datafiles)
     cls._case5 = _get_ctrl_by_name(cls, "Case 5", chief.datafiles)
     cls._case6 = _get_ctrl_by_name(cls, "Case 6", chief.datafiles)
     cls._kw1 = _get_ctrl_by_name(cls, "User KW 1", chief.datafiles)
     cls._kw2 = _get_ctrl_by_name(cls, "User KW 2", chief.datafiles)
Esempio n. 5
0
    def test_sort_and_restore_keywords(self):
        chief = datafilereader.construct_chief_controller(datafilereader.OCCURRENCES_PATH)
        resource_ctrl = self._get_ctrl_by_name(datafilereader.OCCURRENCES_RESOURCE_NAME, chief.datafiles)

        # Capture keyword list before sorting
        original_keywords = resource_ctrl.get_keyword_names()
        list_for_undo_comparison = original_keywords[:]

        # Sort the list
        resource_ctrl.execute(SortKeywords())
        sorted_keywords = resource_ctrl.get_keyword_names()
        original_keywords.sort()
        assert_equals(original_keywords, sorted_keywords)

        # Undo sorting
        resource_ctrl.execute(Undo())
        restored_list = resource_ctrl.get_keyword_names()
        assert_equals(restored_list, list_for_undo_comparison)

        # Redo sorting
        resource_ctrl.execute(Redo())
        keywords_after_redo = resource_ctrl.get_keyword_names()
        assert_equals(keywords_after_redo, sorted_keywords)
 def setUpClass(cls):
     cls.chief = datafilereader.construct_chief_controller(
         datafilereader.IMPORTS)
     suite = cls.chief.data.suites[1]
     cls.imports = [i for i in suite.imports]
Esempio n. 7
0
 def setUpClass(cls):
     cls.chief = datafilereader.construct_chief_controller(datafilereader.IMPORT_ERRORS)
     suite = cls.chief.data.suites[0]
     cls.imports =  [i for i in suite.imports]
 def setUp(self):
     ctrl = datafilereader.construct_chief_controller(datafilereader.LOG_MANY_SUITE)
     self.datafile = datafilereader.get_ctrl_by_name('Log Many', ctrl.datafiles)
     self.testcase = self.datafile.tests[0]
 def test_get_all_keywords_with_resource_file_only(self):
     chief = datafilereader.construct_chief_controller(RESOURCE_PATH)
     all_kws = chief.get_all_keywords()
     chief.close()
     res_kws = [kw for kw in all_kws if kw.name == 'Resource UK']
     assert_equals(len(res_kws), 1)
Esempio n. 10
0
 def setUpClass(cls):
     cls.chief = datafilereader.construct_chief_controller(
         datafilereader.FOR_LOOP_PATH)
Esempio n. 11
0
 def setUp(self):
     self.chief = datafilereader.construct_chief_controller(datafilereader.SIMPLE_TEST_SUITE_PATH)
Esempio n. 12
0
 def setUpClass(cls):
     ctrl = datafilereader.construct_chief_controller(datafilereader.OCCURRENCES_PATH)
     cls.ts1 = datafilereader.get_ctrl_by_name("TestSuite1", ctrl.datafiles)
     cls.ts2 = datafilereader.get_ctrl_by_name("TestSuite2", ctrl.datafiles)
     cls.resu = datafilereader.get_ctrl_by_name(datafilereader.OCCURRENCES_RESOURCE_NAME, ctrl.datafiles)
Esempio n. 13
0
 def test_resource_file_display_name_is_file_name_with_extension(self):
     chief = datafilereader.construct_chief_controller(datafilereader.OCCURRENCES_PATH)
     resource_ctrl = self._get_ctrl_by_name(datafilereader.OCCURRENCES_RESOURCE_NAME, chief.datafiles)
     assert_equals(resource_ctrl.display_name, datafilereader.OCCURRENCES_RESOURCE_FILE)
Esempio n. 14
0
 def test_for_loop_move(self):
     chief = datafilereader.construct_chief_controller(datafilereader.FOR_LOOP_PATH)
     test = chief.datafiles[1].tests[0]
     test.execute(MoveRowsDown([0]))
     test.execute(MoveRowsDown([1]))
     test.get_cell_info(1,1)
Esempio n. 15
0
 def test_get_all_keywords_with_resource_file_only(self):
     chief = datafilereader.construct_chief_controller(RESOURCE_PATH)
     all_kws = chief.get_all_keywords()
     res_kws = [kw for kw in all_kws if kw.name == 'Resource UK']
     assert_equals(len(res_kws), 1)
Esempio n. 16
0
 def setUp(self):
     self._chief = datafilereader.construct_chief_controller(datafilereader.SIMPLE_PROJECT)
     self._test = datafilereader.get_ctrl_by_name('Test Case', self._chief.datafiles[0].tests)
     self._keyword = datafilereader.get_ctrl_by_name('Keyword', self._chief.datafiles[0].keywords)
 def setUp(self):
     self.chief = datafilereader.construct_chief_controller(
         datafilereader.UNUSED_KEYWORDS_PATH)
     self.runner = ReviewRunner(self.chief, self)
Esempio n. 18
0
 def setUpClass(cls):
     cls.chief = datafilereader.construct_chief_controller(datafilereader.SIMPLE_TEST_SUITE_PATH)
     cls.directory = cls.chief.data
     cls.test = datafilereader.get_ctrl_by_name('TestSuite1', cls.chief.datafiles)
     cls.resource = datafilereader.get_ctrl_by_name(datafilereader.SIMPLE_TEST_SUITE_RESOURCE_NAME, cls.chief.datafiles)
     cls.external_resource = datafilereader.get_ctrl_by_name('Resu', cls.chief.datafiles)
Esempio n. 19
0
 def setUpClass(cls):
     cls.chief = datafilereader.construct_chief_controller(datafilereader.FOR_LOOP_PATH)
Esempio n. 20
0
 def setUpClass(cls):
     cls.chief = datafilereader.construct_chief_controller(
         datafilereader.ALL_FILES_PATH)
Esempio n. 21
0
 def setUpClass(cls):
     cls.ctrl = datafilereader.construct_chief_controller(datafilereader.SIMPLE_TEST_SUITE_PATH)
     cls.ts1 = datafilereader.get_ctrl_by_name('TestSuite1', cls.ctrl.datafiles)
     cls.ts2 = datafilereader.get_ctrl_by_name('TestSuite2', cls.ctrl.datafiles)
     cls.resu = datafilereader.get_ctrl_by_name(datafilereader.SIMPLE_TEST_SUITE_RESOURCE_NAME, cls.ctrl.datafiles)
Esempio n. 22
0
 def setUpClass(cls):
     cls.chief = datafilereader.construct_chief_controller(datafilereader.ALL_FILES_PATH)
Esempio n. 23
0
 def setUp(self):
     self.chief = datafilereader.construct_chief_controller(datafilereader.UNUSED_KEYWORDS_PATH)
     self.runner = ReviewRunner(self.chief, self)
 def setUp(self):
     self.chief_ctrl = datafilereader.construct_chief_controller(
         datafilereader.LOG_MANY_SUITE)
     self.datafile = datafilereader.get_ctrl_by_name(
         'Log Many', self.chief_ctrl.datafiles)
     self.testcase = self.datafile.tests[0]
Esempio n. 25
0
 def setUpClass(cls):
     chief = datafilereader.construct_chief_controller(datafilereader.OCCURRENCES_PATH)
     cls.directory = chief.data
     cls.test = datafilereader.get_ctrl_by_name('TestSuite1', chief.datafiles)
     cls.resource = datafilereader.get_ctrl_by_name(datafilereader.OCCURRENCES_RESOURCE_NAME, chief.datafiles)
     cls.external_resource = datafilereader.get_ctrl_by_name('Resu', chief.datafiles)
Esempio n. 26
0
 def setUp(self):
     self.chief = datafilereader.construct_chief_controller(
         datafilereader.SIMPLE_TEST_SUITE_PATH, tempfile.gettempdir())