from unittest import mock import pytest from url_shortener.exceptions import NotAllowedDomainError from url_shortener.services import UpdatePathService class TestUpdatePathService: async def test_update_path_service_not_allowed_domain( self, service: UpdatePathService, dynamodb_client_mock: mock.AsyncMock ) -> None: with pytest.raises(NotAllowedDomainError): await service.update_path( "test-path", {"domain": "not-allowed-domain.com"}, ) dynamodb_client_mock.get_item.assert_not_called() dynamodb_client_mock.update_item.assert_not_called()