コード例 #1
0
    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()
コード例 #2
0
    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()
コード例 #3
0
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
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
ファイル: model.py プロジェクト: superbaby11/autoOMC
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)))
コード例 #7
0
 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)
コード例 #8
0
ファイル: tidy.py プロジェクト: Lina9201/Python
 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)
コード例 #9
0
 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()
コード例 #10
0
 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()