mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-19 14:36:22 -05:00
Adding API App route for index.
This commit is contained in:
parent
6ace7cc098
commit
e5fe1b6bb9
2 changed files with 5 additions and 1 deletions
|
|
@ -109,6 +109,7 @@ index_html = '''
|
|||
'''
|
||||
|
||||
|
||||
@api_app.get('/')
|
||||
@api_bp.get('/')
|
||||
async def index(_):
|
||||
return response.html(index_html)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ from mock import mock
|
|||
|
||||
from wrolpi.admin import HotspotStatus
|
||||
from wrolpi.common import get_config
|
||||
from wrolpi.dates import strptime
|
||||
from wrolpi.db import get_db_session
|
||||
from wrolpi.downloader import Download, get_download_manager_config
|
||||
from wrolpi.root_api import api_app
|
||||
|
|
@ -24,6 +23,10 @@ class TestRootAPI(TestAPI):
|
|||
assert response.status_code == HTTPStatus.OK
|
||||
assert b'html' in response.body
|
||||
|
||||
request, response = api_app.test_client.get('/api')
|
||||
assert response.status_code == HTTPStatus.OK
|
||||
assert b'html' in response.body
|
||||
|
||||
def test_echo(self):
|
||||
"""
|
||||
Echo should send back a JSON object with our request details.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue