tests: test generation of dynamic pages

Test the generation of routes from the markdown input files stored
under pages.

Currently only the routing is tested, not the contents of the files.

Signed-off-by: Johannes Thumshirn <jth@kernel.org>
pull/17/head
Johannes Thumshirn 4 years ago
parent 0d9f944118
commit 845739eb80

@ -0,0 +1,13 @@
# SPDX-License-Identifier: GPL-3.0
import pytest
from app import app as flask_app
@pytest.fixture
def app():
yield flask_app
@pytest.fixture
def client(app):
return app.test_client()

@ -0,0 +1,13 @@
# SPDX-License-Identifier: GPL-3.0
import os
def test_index(app, client):
for f in os.listdir('pages'):
if not f.endswith('.md'):
continue
dynamic_file = f.split('.', 1)[0]
page = "/" + dynamic_file + ".html"
print("Checking presence of: ", page)
res = client.get(page)
assert res.status_code == 200
Loading…
Cancel
Save