File tree Expand file tree Collapse file tree 3 files changed +35
-5
lines changed
packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/notifications
services/notifications/tests Expand file tree Collapse file tree 3 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 1- async def send_notification_message ():
2- pass
1+ from typing import Final
2+
3+ from models_library .api_schemas_notifications import NOTIFICATIONS_RPC_NAMESPACE
4+ from models_library .rabbitmq_basic_types import RPCMethodName
5+ from models_library .rpc .notifications .messages import NotificationMessage , Recipient
6+ from pydantic import NonNegativeInt , TypeAdapter
7+
8+ from ... import RabbitMQRPCClient
9+
10+ _DEFAULT_TIMEOUT_S : Final [NonNegativeInt ] = 30
11+
12+
13+ async def send_notification_message (
14+ rabbitmq_rpc_client : RabbitMQRPCClient ,
15+ * ,
16+ message : NotificationMessage ,
17+ recipients : list [Recipient ],
18+ ) -> None :
19+ await rabbitmq_rpc_client .request (
20+ NOTIFICATIONS_RPC_NAMESPACE ,
21+ TypeAdapter (RPCMethodName ).validate_python ("send_notification_message" ),
22+ timeout_s = _DEFAULT_TIMEOUT_S ,
23+ message = message ,
24+ recipients = recipients ,
25+ )
Original file line number Diff line number Diff line change 2424from simcore_service_notifications .core .application import create_app
2525from simcore_service_notifications .core .settings import ApplicationSettings
2626from simcore_service_notifications .modules .celery .tasks import (
27- TaskQueue , # type: ignore[import-untyped]
28- )
29- from simcore_service_notifications .modules .celery .tasks import (
27+ TaskQueue ,
3028 setup_worker_tasks ,
3129)
3230
Original file line number Diff line number Diff line change 1+ from celery .contrib .testing .worker import TestWorkController
2+ from servicelib .rabbitmq import RabbitMQRPCClient
3+
4+
5+ async def test_send_email (
6+ notifications_rabbitmq_rpc_client : RabbitMQRPCClient ,
7+ with_celery_worker : TestWorkController ,
8+ ):
9+ pass
You can’t perform that action at this time.
0 commit comments