示例#1
0
    def __init__(self, path):
        source_extension = re.escape(SOURCE_EXTENSION)
        path = to_posix_path(path.strip())

        path_to, filename = posixpath.split(path)
        path_to = '.' if not path_to else path_to
        name = re.search(r'(.+)%s$' % source_extension, filename).group(1)

        answer_filename = name + ANSWER_EXTENSION
        output_filename = name + OUTPUT_EXTENSION

        self.source = TestComponent(path, path_to, name, filename)
        self.answer = TestComponent(posixpath.join(path_to, answer_filename),
                                    path_to, name, answer_filename)
        self.output = TestComponent(posixpath.join(path_to, output_filename),
                                    path_to, name, output_filename)
示例#2
0
文件: testing.py 项目: Sudoka/yuno
    def __init__(self, path):
        source_extension = re.escape(SOURCE_EXTENSION)
        path = re.sub(r'^\.{1,2}[/\\]', '', to_posix_path(path.strip()))

        path_to, filename = posixpath.split(path)
        name = os.path.splitext(filename)[0]

        answer_filename = name + ANSWER_EXTENSION
        output_filename = name + OUTPUT_EXTENSION

        self.source = TestComponent(path, path_to, name, filename)
        self.answer = TestComponent(
            posixpath.join(path_to, answer_filename),
            path_to,
            name,
            answer_filename
        )
        self.output = TestComponent(
            posixpath.join(path_to, output_filename),
            path_to,
            name,
            output_filename
        )
示例#3
0
文件: testing.py 项目: jenrzzz/yuno
    def __init__(self, path):
        source_extension = re.escape(SOURCE_EXTENSION)
        path = to_posix_path(path.strip())

        path_to, filename = posixpath.split(path)
        path_to = '.' if not path_to else path_to
        name = re.search(r'(.+)%s$' % source_extension, filename).group(1)

        answer_filename = name + ANSWER_EXTENSION
        output_filename = name + OUTPUT_EXTENSION

        self.source = TestComponent(path, path_to, name, filename)
        self.answer = TestComponent(
            posixpath.join(path_to, answer_filename),
            path_to,
            name,
            answer_filename
        )
        self.output = TestComponent(
            posixpath.join(path_to, output_filename),
            path_to,
            name,
            output_filename
        )