29 lines
453 B
Python
29 lines
453 B
Python
|
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()
|