mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Building the methods around async stats work
This commit is contained in:
19
tests/app/dao/test_statistics_dao.py
Normal file
19
tests/app/dao/test_statistics_dao.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from app.dao.statistics_dao import persist_initial_job_statistics
|
||||
from app.models import JobStatistics
|
||||
from tests.app.conftest import sample_notification
|
||||
|
||||
|
||||
def test_should_create_a_stats_entry_for_a_job(
|
||||
notify_db, notify_db_session, sample_service, sample_template, sample_job
|
||||
):
|
||||
assert not len(JobStatistics.query.all())
|
||||
|
||||
notification = sample_notification(
|
||||
notify_db, notify_db_session, service=sample_service, template=sample_template, job=sample_job
|
||||
)
|
||||
|
||||
persist_initial_job_statistics(notification)
|
||||
|
||||
stats = JobStatistics.query.all()
|
||||
|
||||
assert len(stats) == 1
|
||||
Reference in New Issue
Block a user