# Path: openid/test/discoverdata.py
# def getDataName(*components):
# def getExampleXRDS():
# def readTests(filename):
# def getData(filename, name):
# def fillTemplate(test_name, template, base_url, example_xrds):
# def generateSample(test_name, base_url,
#                    example_xrds=example_xrds,
#                    filename=default_test_file):
# def generateResult(base_url, input_name, id_name, result_name, success):


import os.path
    import sys
from six.moves.urllib.parse import urljoin
from openid.test import discoverdata


manifest_header = """\
# This file contains test cases for doing YADIS identity URL and
# service discovery. For each case, there are three URLs. The first
# URL is the user input. The second is the identity URL and the third
# is the URL from which the XRDS document should be read.
#
# The file format is as follows:
# User URL <tab> Identity URL <tab> XRDS URL <newline>
#
# blank lines and lines starting with # should be ignored.
#
# To use this test:
#
# 1. Run your discovery routine on the User URL.
#
# 2. Compare the identity URL returned by the discovery routine to the
#    identity URL on that line of the file. It must be an EXACT match.
#
# 3. Do a regular HTTP GET on the XRDS URL. Compare the content that
#    was returned by your discovery routine with the content returned
#    from that URL. It should also be an exact match.

"""


def buildDiscover(base_url, out_dir):
    """Convert all files in a directory to apache mod_asis files in
    another directory."""

# Path: openid/test/discoverdata.py
# def getDataName(*components):
# def getExampleXRDS():
# def readTests(filename):
# def getData(filename, name):
# def fillTemplate(test_name, template, base_url, example_xrds):
# def generateSample(test_name, base_url,
#                    example_xrds=example_xrds,
#                    filename=default_test_file):
# def generateResult(base_url, input_name, id_name, result_name, success):


# Path: admin/builddiscover.py
import os.path
    import sys
from six.moves.urllib.parse import urljoin
from openid.test import discoverdata



manifest_header = """\
# This file contains test cases for doing YADIS identity URL and
# service discovery. For each case, there are three URLs. The first
# URL is the user input. The second is the identity URL and the third
# is the URL from which the XRDS document should be read.
#
# The file format is as follows:
# User URL <tab> Identity URL <tab> XRDS URL <newline>
#
# blank lines and lines starting with # should be ignored.
#
# To use this test:
#
# 1. Run your discovery routine on the User URL.
#
# 2. Compare the identity URL returned by the discovery routine to the
#    identity URL on that line of the file. It must be an EXACT match.
#
# 3. Do a regular HTTP GET on the XRDS URL. Compare the content that
#    was returned by your discovery routine with the content returned
#    from that URL. It should also be an exact match.

"""


def buildDiscover(base_url, out_dir):
    """Convert all files in a directory to apache mod_asis files in
    another directory."""

    test_data = discoverdata.readTests(discoverdata.default_test_file)