This commit is contained in:
Mateusz Gruszczyński
2026-03-05 15:53:33 +01:00
commit e8f6c4c609
74 changed files with 4482 additions and 0 deletions

19
tests/conftest.py Normal file
View File

@@ -0,0 +1,19 @@
import os
import pytest
from mikromon import create_app, db
@pytest.fixture()
def app(tmp_path):
os.environ["DATABASE_URL"] = f"sqlite:///{tmp_path/'test.db'}"
os.environ["DEV_INPROCESS_POLLER"] = "0"
os.environ["SECRET_KEY"] = "test-secret"
# Fernet key
os.environ["CRED_ENC_KEY"] = "WmQxY2pKQ0FqV0lJdVFSWFBzYlJKUTZkdmJpZGFjY0k=" # dummy base64, will fail if used; tests avoid decrypt
app = create_app()
with app.app_context():
db.create_all()
yield app
@pytest.fixture()
def client(app):
return app.test_client()