mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
New endpoint to set ServiceInboundApi data.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from app.dao.service_inbound_api_dao import save_service_inbound_api
|
||||
from app.models import ServiceInboundApi
|
||||
|
||||
@@ -18,3 +23,14 @@ def test_save_service_inbound_api(sample_service):
|
||||
assert results[0].url == "https::/some_service/inbound_messages"
|
||||
assert results[0].unsigned_bearer_token == "some_unique_string"
|
||||
assert results[0].bearer_token != "some_unique_string"
|
||||
|
||||
|
||||
def test_save_service_inbound_api_fails_if_service_doesnot_exist(notify_db, notify_db_session):
|
||||
service_inbound_api = ServiceInboundApi(
|
||||
service_id=uuid.uuid4(),
|
||||
url="https::/some_service/inbound_messages",
|
||||
bearer_token="some_unique_string"
|
||||
)
|
||||
|
||||
with pytest.raises(SQLAlchemyError):
|
||||
save_service_inbound_api(service_inbound_api)
|
||||
|
||||
Reference in New Issue
Block a user