Skip to content

Commit

Permalink
Increase unit test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Plowman committed Oct 18, 2023
1 parent c008281 commit 342e73a
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion application/quality_checker/tests/test_quality_checker.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
from dataclasses import dataclass
from os import environ
from unittest.mock import MagicMock, call, patch

import pytest
from aws_lambda_powertools.utilities.typing import LambdaContext

from application.quality_checker.quality_checker import check_dos_data_quality, lambda_handler
from application.quality_checker.quality_checker import (
check_dos_data_quality,
lambda_handler,
send_errored_metric,
send_finished_metric,
)
from common.commissioned_service_type import BLOOD_PRESSURE, CONTRACEPTION, PALLIATIVE_CARE

FILE_PATH = "application.quality_checker.quality_checker"
Expand Down Expand Up @@ -63,3 +69,21 @@ def test_check_dos_data_quality(
call(mock_connect_to_db_reader().__enter__(), CONTRACEPTION),
],
)


def test_send_finished_metric():
# Arrange
environ["ENV"] = "test"
# Act
send_finished_metric()
# Clean up
del environ["ENV"]


def test_send_errored_metric():
# Arrange
environ["ENV"] = "test"
# Act
send_errored_metric()
# Clean up
del environ["ENV"]

0 comments on commit 342e73a

Please sign in to comment.