From a7ed31afd9c07b752a97aaaa971831d9336e657c Mon Sep 17 00:00:00 2001 From: Julien Alie Date: Tue, 2 Apr 2024 10:11:25 -0400 Subject: [PATCH] fix integration tests - Fix an issue w/ calls without tenant_uuid or user_uuid - Up default parking timeout to 45 to prevent channels from timing out before all channels are parked with a slow asterisk --- .../assets/etc/asterisk/res_parking.conf | 2 +- integration_tests/suite/test_parkings.py | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/integration_tests/assets/etc/asterisk/res_parking.conf b/integration_tests/assets/etc/asterisk/res_parking.conf index f73343207..bce6d0be5 100644 --- a/integration_tests/assets/etc/asterisk/res_parking.conf +++ b/integration_tests/assets/etc/asterisk/res_parking.conf @@ -3,7 +3,7 @@ parkext = 500 context = parkings parkedmusicclass = default parkpos = 501-510 -parkingtime = 5 +parkingtime = 45 findslot = next parkext_exclusive = yes diff --git a/integration_tests/suite/test_parkings.py b/integration_tests/suite/test_parkings.py index 0bc79e3be..d8ff57a75 100644 --- a/integration_tests/suite/test_parkings.py +++ b/integration_tests/suite/test_parkings.py @@ -39,7 +39,7 @@ class ParkingLotArgs(TypedDict, total=False): id: Required[int] tenant_uuid: NotRequired[str] name: NotRequired[str] - extension: NotRequired[int] + extension: NotRequired[str] slots_start: NotRequired[str] slots_end: NotRequired[str] timeout: NotRequired[int] @@ -50,16 +50,16 @@ class ParkingLotArgs(TypedDict, total=False): 'id': 1, 'tenant_uuid': VALID_TENANT, 'name': 'First Parking', - 'extension': 500, + 'extension': '500', 'slots_start': '501', 'slots_end': '510', - 'timeout': 5, + 'timeout': 45, } PARKINGLOT_2: ParkingLotArgs = { 'id': 2, 'tenant_uuid': 'b93892f0-5300-4682-aede-3104b449ba69', 'name': 'Second Parking', - 'extension': 600, + 'extension': '600', 'slots_start': '601', 'slots_end': '602', 'timeout': 0, @@ -116,14 +116,13 @@ def given_parked_call( self, parking_extension: str, *, - tenant_uuid: str | None = VALID_TENANT, + tenant_uuid: str | None = None, user_uuid: str | None = None, ) -> Generator[str, None, None]: - variables = {} - if tenant_uuid: - variables['WAZO_TENANT_UUID'] = tenant_uuid - if user_uuid: - variables['WAZO_USERUUID'] = user_uuid + variables = { + 'WAZO_TENANT_UUID': tenant_uuid or VALID_TENANT, + 'WAZO_USERUUID': user_uuid or random_uuid(), + } channel = self.ari.channels.originate( endpoint=ENDPOINT_AUTOANSWER,