# Path: artman/tasks/descriptor_set_tasks.py
# class PythonDocsConvertionTask(task_base.TaskBase):
# class EmptyDescriptorTask(task_base.EmptyTask):
#     def execute(self, descriptor_set):
# def _replace(comment, pattern, repl_fn):
# def _replace_proto_link(comment):
#     def _format(m):
# def _replace_relative_link(comment):
#     def _format(m):
# def _insert_spaces(comment):
#     def _format(m):
# def _add_space(comment):
#     def _format(m):
# def md2rst(comment):
# def get_descriptor_set_task(language):
# _DESC_TASK_DICT = {
#     'python': PythonDocsConvertionTask,
# }


import unittest
import pypandoc
import mock
import restructuredtext_lint
from artman.tasks import descriptor_set_tasks
from google.protobuf import descriptor_pb2 as desc
    def test_proto_link_re(self):
        valid_tests = [
            ["[Foo][bar.Foo]", [("Foo", "bar.Foo")]],
            ["[Foo][]", [("Foo", "")]],
            [
                "test [Foo][bar.Foo] fuzz [Baz][fob.Baz] bunk",
                [("Foo", "bar.Foo"), ("Baz", "fob.Baz")]
            ]
        ]
        invalid_tests = [
            "[][Foo]",
            "[Foo](baz)"
        ]
        self._test_pattern(descriptor_set_tasks._proto_link_re,
                           valid_tests, invalid_tests)

    def test_relative_link_re(self):
        valid_tests = [
            ["[Foo](/foo/bar)", [("Foo", "/foo/bar")]],
            [
                "test [Foo](/foo/bar) fuzz [Baz](/fob/baz) bunk",
                [("Foo", "/foo/bar"), ("Baz", "/fob/baz")]
            ]
        ]
        invalid_tests = [
            "[link]()",
            "[](foo)",
            "[Foo](foo/bar)",
            "[link](https://foo)",
        ]

# Path: artman/tasks/descriptor_set_tasks.py
# class PythonDocsConvertionTask(task_base.TaskBase):
# class EmptyDescriptorTask(task_base.EmptyTask):
#     def execute(self, descriptor_set):
# def _replace(comment, pattern, repl_fn):
# def _replace_proto_link(comment):
#     def _format(m):
# def _replace_relative_link(comment):
#     def _format(m):
# def _insert_spaces(comment):
#     def _format(m):
# def _add_space(comment):
#     def _format(m):
# def md2rst(comment):
# def get_descriptor_set_task(language):
# _DESC_TASK_DICT = {
#     'python': PythonDocsConvertionTask,
# }


# Path: test/tasks/test_descriptor.py
import unittest
import pypandoc
import mock
import restructuredtext_lint
from artman.tasks import descriptor_set_tasks
from google.protobuf import descriptor_pb2 as desc

    def test_proto_link_re(self):
        valid_tests = [
            ["[Foo][bar.Foo]", [("Foo", "bar.Foo")]],
            ["[Foo][]", [("Foo", "")]],
            [
                "test [Foo][bar.Foo] fuzz [Baz][fob.Baz] bunk",
                [("Foo", "bar.Foo"), ("Baz", "fob.Baz")]
            ]
        ]
        invalid_tests = [
            "[][Foo]",
            "[Foo](baz)"
        ]
        self._test_pattern(descriptor_set_tasks._proto_link_re,
                           valid_tests, invalid_tests)

    def test_relative_link_re(self):
        valid_tests = [
            ["[Foo](/foo/bar)", [("Foo", "/foo/bar")]],
            [
                "test [Foo](/foo/bar) fuzz [Baz](/fob/baz) bunk",
                [("Foo", "/foo/bar"), ("Baz", "/fob/baz")]
            ]
        ]
        invalid_tests = [
            "[link]()",
            "[](foo)",
            "[Foo](foo/bar)",
            "[link](https://foo)",
        ]

        self._test_pattern(descriptor_set_tasks._relative_link_re,