Merge pull request #17 from morbidrsa/test-dynamic-pages

tests: test generation of dynamic pages
pull/20/head
Johannes Thumshirn 4 years ago committed by GitHub
commit 7857876eb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,11 @@
# SPDX-License-Identifier: GPL-3.0
import os
def test_index_html(app, client):
res = client.get('/index.html')
assert res.status_code == 200
def test_index_slash(app, client):
res = client.get('/')
assert res.status_code == 200

@ -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