# Path: pypi_redirect/pypi_redirect/server_app/index_builder.py
# def build(index_rows):
# def _rows_for_file(package_filename, index_row):
# def _format_row(filename):
# def _escape_for_html(s, quote=False):
# 
# Path: pypi_redirect/pypi_redirect/server_app/index_parser.py
# def _all_internal_links_and_directories(html_root):
# def parse(
#         base_url,
#         package_path,
#         html_str,
#         strict_html=True,
#         find_links_fn=_all_internal_links_and_directories):
# def _parse_internal_links(base_url, html_root, package_path, find_links_fn):
# def _is_ascii(s):
# def _parse_html(html_str, strict_html):
# def _is_absolute_url(url):
# def _make_url_absolute(base_url, package_path, url):
# def _determine_checksums(href):


from collections import OrderedDict
from nose.tools import eq_
from _utils import read_index
from ...server_app import index_builder
from ...server_app.index_parser import IndexRow, Checksums


def typical_index_test():
    index_rows = OrderedDict([
        ('Sphinx-0.6.4-py2.5.egg',
            IndexRow(
                download_url=(
                    'https://pypi.python.org/simple/Sphinx/'
                    '../../packages/2.5/S/Sphinx/Sphinx-0.6.4-py2.5.egg'
                    '#md5=b9e637ba15a27b31b7f94b8809cdebe3'),

# Path: pypi_redirect/pypi_redirect/server_app/index_builder.py
# def build(index_rows):
# def _rows_for_file(package_filename, index_row):
# def _format_row(filename):
# def _escape_for_html(s, quote=False):
# 
# Path: pypi_redirect/pypi_redirect/server_app/index_parser.py
# def _all_internal_links_and_directories(html_root):
# def parse(
#         base_url,
#         package_path,
#         html_str,
#         strict_html=True,
#         find_links_fn=_all_internal_links_and_directories):
# def _parse_internal_links(base_url, html_root, package_path, find_links_fn):
# def _is_ascii(s):
# def _parse_html(html_str, strict_html):
# def _is_absolute_url(url):
# def _make_url_absolute(base_url, package_path, url):
# def _determine_checksums(href):


# Path: pypi_redirect/pypi_redirect/test/unit_tests/index_builder_test.py
from collections import OrderedDict
from nose.tools import eq_
from _utils import read_index
from ...server_app import index_builder
from ...server_app.index_parser import IndexRow, Checksums



def typical_index_test():
    index_rows = OrderedDict([
        ('Sphinx-0.6.4-py2.5.egg',
            IndexRow(
                download_url=(
                    'https://pypi.python.org/simple/Sphinx/'
                    '../../packages/2.5/S/Sphinx/Sphinx-0.6.4-py2.5.egg'
                    '#md5=b9e637ba15a27b31b7f94b8809cdebe3'),

                checksums=Checksums(