Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Kehl committed Jan 28, 2025
1 parent efe9024 commit ae499fd
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/app/service/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3715,22 +3715,22 @@ def test_get_service_notification_statistics_by_day(
assert response == mock_data


def test_valid_request():
request = MagicMock()
request.args = {
"service_id": "123",
"name": "Test Name",
"email_from": "[email protected]",
}
result = check_request_args(request)
assert result == ("123", "Test Name", "[email protected]")


def test_missing_service_id():
request = MagicMock()
request.args = {"name": "Test Name", "email_from": "[email protected]"}
try:
check_request_args(request)
except Exception as e:
assert e.status_code == 400
assert {"service_id": ["Can't be empty"] in e.errors}
# def test_valid_request():
# request = MagicMock()
# request.args = {
# "service_id": "123",
# "name": "Test Name",
# "email_from": "[email protected]",
# }
# result = check_request_args(request)
# assert result == ("123", "Test Name", "[email protected]")


# def test_missing_service_id():
# request = MagicMock()
# request.args = {"name": "Test Name", "email_from": "[email protected]"}
# try:
# check_request_args(request)
# except Exception as e:
# assert e.status_code == 400
# assert {"service_id": ["Can't be empty"] in e.errors}

0 comments on commit ae499fd

Please sign in to comment.