# Path: lepo_tests/utils.py
# def get_urlpatterns(handler_module, definition_file='swagger2/petstore-expanded.yaml'):
# def generate_urlconf_module(handler_style, version):
# def generate_urlconf_modules(handler_styles, versions):
# URLCONF_TEMPLATE = '''
# from lepo_tests.handlers import %(module)s
# from lepo_tests.utils import get_urlpatterns
# urlpatterns = get_urlpatterns(%(module)s, %(file)r)
# '''


import pytest
from lepo_tests.utils import urlconf_map



# TODO: test OpenAPI 3 too
@pytest.mark.urls(urlconf_map[('pets_cb', 'swagger2')].__name__)
def test_docs(client):
    assert '/api/swagger.json' in client.get('/api/docs/').content.decode('utf-8')

# Path: lepo_tests/utils.py
# def get_urlpatterns(handler_module, definition_file='swagger2/petstore-expanded.yaml'):
# def generate_urlconf_module(handler_style, version):
# def generate_urlconf_modules(handler_styles, versions):
# URLCONF_TEMPLATE = '''
# from lepo_tests.handlers import %(module)s
# from lepo_tests.utils import get_urlpatterns
# urlpatterns = get_urlpatterns(%(module)s, %(file)r)
# '''


# Path: lepo_tests/tests/test_doc.py
import pytest
from lepo_tests.utils import urlconf_map




# TODO: test OpenAPI 3 too
@pytest.mark.urls(urlconf_map[('pets_cb', 'swagger2')].__name__)
def test_docs(client):
    assert '/api/swagger.json' in client.get('/api/docs/').content.decode('utf-8')

    assert client.get('/api/swagger.json').content.startswith(b'{')