def _select_test_case_and_suite(self, ava_ele_list, record_kw): a = [] for i in record_kw: a.append(i) for k, v in page_futs.iteritems(): if k in self.page_goto.keys(): continue match_page_ok = True for i in v: if not i in ava_ele_list: match_page_ok = False break if match_page_ok: self.page_goto[k] = a for name in test_case_file_list: suite = TestCaseFile(source=name).populate() for test in suite.testcase_table: if test.tags.value != None: continue case_fts = self._get_match_futs(test.doc.value) if case_fts == None: continue match_case_ok = True for i in case_fts: if not i in ava_ele_list: match_case_ok = False break if match_case_ok: self.case_goto[test.name] = a test.tags.value = ["include"] suite.save()
def _select_test_case_and_suite(self, ava_ele_list, record_kw): a = [] for i in record_kw: a.append(i) for k, v in page_futs.iteritems(): if k in self.page_goto.keys(): continue match_page_ok = True for i in v: if not i in ava_ele_list: match_page_ok = False break if match_page_ok: self.page_goto[k] = a for name in test_case_file_list: suite = TestCaseFile(source=name).populate() for test in suite.testcase_table: if test.tags.value != None: continue case_fts = self._get_match_futs(test.doc.value) if case_fts == None: continue match_case_ok = True for i in case_fts: if not i in ava_ele_list: match_case_ok = False break if match_case_ok: self.case_goto[test.name] = a test.tags.value = ['include'] suite.save()
def create_test_case_file(): data = TestCaseFile(source='foo.txt') table = TestCaseTable(data) data.testcase_table = table table.set_header(['test case', 'some', 'and other']) test = table.add('A test') test.add_step(['A kw', 'an arg']) return data
def create_test_case_file(): data = TestCaseFile(source="foo.txt") table = TestCaseTable(data) data.testcase_table = table table.set_header(["test case", "some", "and other"]) test = table.add("A test") test.add_step(["A kw", "an arg"]) return data
def _parse_suite(path, include_suites): try: if os.path.isdir(path): return TestDataDirectory(source=path, include_suites=include_suites) return TestCaseFile(source=path) except DataError, err: raise DataError("Parsing '%s' failed: %s" % (path, unicode(err)))
def _create_datafile(self, source): if self._is_init_file(source): dir_ = os.path.dirname(source) return TestDataDirectory(source=dir_).populate(recurse=False) try: return TestCaseFile(source=source).populate() except DataError: try: return ResourceFile(source=source).populate() except DataError: raise DataError("Invalid data source '%s'." % source)
def _parse_data(self, path): if os.path.isdir(path): return TestDataDirectory(source=path).populate() if self._is_init_file(path): path = os.path.dirname(path) return TestDataDirectory(source=path).populate(recurse=False) try: return TestCaseFile(source=path).populate() except DataError: try: return ResourceFile(source=path).populate() except DataError: raise DataError("Invalid data source '%s'." % path)
def clear_test_case_tag(self): for name in test_case_file_list: suite = TestCaseFile(source=name).populate() for test in suite.testcase_table: test.tags.value = None suite.save()