First tests!

This commit is contained in:
2022-03-10 11:22:04 +01:00
parent d7f8fcec88
commit 1494f1a5e0
6 changed files with 97 additions and 0 deletions

28
tests/conftest.py Normal file
View File

@ -0,0 +1,28 @@
import pytest
from jail2ban import create_app
@pytest.fixture()
def app():
app = create_app()
app.config.update({
"TESTING": True,
"SECRET_KEY": 'Testing',
"AUTHFILE": 'tests/users-test.txt'
})
# other setup can go here
yield app
# clean up / reset resources here
@pytest.fixture()
def client(app):
return app.test_client()
@pytest.fixture()
def runner(app):
return app.test_cli_runner()