From 04c09ae8addbfdbf9a4247077fd30d9125eea791 Mon Sep 17 00:00:00 2001 From: Jonathan Rios Date: Mon, 18 Nov 2024 11:55:23 +0100 Subject: [PATCH] LITE-31371 Add renew request event --- connect/eaas/core/enums.py | 1 + tests/connect/eaas/core/test_extension.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/connect/eaas/core/enums.py b/connect/eaas/core/enums.py index 77e60cd..28f4b64 100644 --- a/connect/eaas/core/enums.py +++ b/connect/eaas/core/enums.py @@ -5,6 +5,7 @@ class EventType: ASSET_RESUME_REQUEST_PROCESSING = 'asset_resume_request_processing' ASSET_CANCEL_REQUEST_PROCESSING = 'asset_cancel_request_processing' ASSET_ADJUSTMENT_REQUEST_PROCESSING = 'asset_adjustment_request_processing' + ASSET_RENEW_REQUEST_PROCESSING = 'asset_renew_request_processing' ASSET_PURCHASE_REQUEST_VALIDATION = 'asset_purchase_request_validation' ASSET_CHANGE_REQUEST_VALIDATION = 'asset_change_request_validation' PRODUCT_ACTION_EXECUTION = 'product_action_execution' diff --git a/tests/connect/eaas/core/test_extension.py b/tests/connect/eaas/core/test_extension.py index 45bc152..3f8711c 100644 --- a/tests/connect/eaas/core/test_extension.py +++ b/tests/connect/eaas/core/test_extension.py @@ -54,6 +54,13 @@ def process_purchase(self, request): async def process_change(self, request): pass + @event( + 'asset_renew_request_processing', + statuses=['pending', 'inquiring'], + ) + def process_renew(self, request): + pass + assert sorted(MyExtension.get_events(), key=lambda x: x['method']) == [ { 'method': 'process_change', @@ -65,6 +72,11 @@ async def process_change(self, request): 'event_type': 'asset_purchase_request_processing', 'statuses': ['pending', 'inquiring'], }, + { + 'method': 'process_renew', + 'event_type': 'asset_renew_request_processing', + 'statuses': ['pending', 'inquiring'], + }, ] assert MyExtension(None, None, None).process_purchase.__name__ == 'process_purchase'