Build Flask WAF log converter app
This commit is contained in:
26
tests/conftest.py
Normal file
26
tests/conftest.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from app import create_app
|
||||
|
||||
|
||||
class TestConfig:
|
||||
TESTING = True
|
||||
SECRET_KEY = "test-secret"
|
||||
MAX_CONTENT_LENGTH = 1024 * 1024
|
||||
PREVIEW_RECORD_LIMIT = 5
|
||||
OUTPUT_DIRECTORY = "test-outputs"
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def app():
|
||||
flask_app = create_app(TestConfig)
|
||||
yield flask_app
|
||||
shutil.rmtree(Path(flask_app.instance_path) / "test-outputs", ignore_errors=True)
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def client(app):
|
||||
return app.test_client()
|
||||
Reference in New Issue
Block a user