def test_render_link_targets():
    renderer = RendererRST()

    tests = [
        [
            {},
            "",
        ],
        [
            {"CompactSize"},
            "\n.. _CompactSize: types/CompactSize.html\n",
        ],
        [
            {"int8"},
            "\n.. _int8: types/Integers.html\n",
        ],
        [
            {"uint64"},
            "\n.. _uint64: types/Integers.html\n",
        ],
        [
            {"uint64", "uint256"},
            "\n.. _uint256: types/Integers.html\n.. _uint64: types/Integers.html\n",
        ],
    ]

    for test in tests:
        renderer.link_targets = test[0]
        assert renderer.render_link_targets() == test[1]
def test_render_doc_example3():
    renderer = RendererRST()
    with open("test_data/doc_data/types/vector.txt") as doc_file:
        doc_data = DocProcessor().process(DocParser().parse(doc_file.read()))
        rendered = renderer.render_doc("types/vector", doc_data)
    rendered += renderer.render_link_targets()
    with open("test_data/expected/types/vector.rst") as expected_file:
        assert rendered == expected_file.read()