From a7d0a0cbe8e3935189692ddc5dbff20aba513a6d Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Fri, 5 Mar 2021 11:18:40 -0700 Subject: [PATCH] Fixed EVERYTHING --- .../phonenumbers/_phone_numbers_client.py | 2 - .../aio/_phone_numbers_client_async.py | 11 +-- .../test/_shared/testcase.py | 20 +++- ...stration_client.test_get_phone_number.yaml | 9 +- ...ient.test_list_acquired_phone_numbers.yaml | 30 +++++- ...d_phone_numbers_from_managed_identity.yaml | 67 +++++++++++++ ...on_client.test_purchase_phone_numbers.yaml | 91 +++++++++--------- ...tion_client.test_release_phone_number.yaml | 46 --------- ...t.test_search_available_phone_numbers.yaml | 44 +++++---- ...test_update_phone_number_capabilities.yaml | 39 ++++---- ...on_client_async.test_get_phone_number.yaml | 10 +- ...sync.test_list_acquired_phone_numbers.yaml | 40 ++++---- ...d_phone_numbers_from_managed_identity.yaml | 57 +++++++++++ ...l_phone_numbers_from_managed_identity.yaml | 25 ----- ...ent_async.test_purchase_phone_numbers.yaml | 96 +++++++++---------- ...c.test_search_available_phone_numbers.yaml | 14 +-- ...test_update_phone_number_capabilities.yaml | 18 ++-- ...test_phone_number_administration_client.py | 19 ++-- ...hone_number_administration_client_async.py | 23 ++--- 19 files changed, 370 insertions(+), 291 deletions(-) create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index f392b4a00ae3..a3262d4012f7 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -166,7 +166,6 @@ def begin_update_phone_number_capabilities( :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType - :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -194,7 +193,6 @@ def get_phone_number( :param phone_number: The acquired phone number whose details are to be fetched in E.164 format, e.g. +11234567890. :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber """ return self._phone_number_client.phone_numbers.get_by_number( diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 5a19b27c6513..994071dc72b9 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -60,7 +60,7 @@ async def begin_purchase_phone_numbers( search_id, # type: str **kwargs # type: Any ): - # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] + # type: (...) -> AsyncLROPoller[None] """Purchases phone numbers. :param search_id: The search id. @@ -89,7 +89,6 @@ async def begin_release_phone_number( :param phone_number: Phone number to be released, e.g. +11234567890. :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -110,7 +109,6 @@ async def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, - quantity=None, # type: int **kwargs ): # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] @@ -128,10 +126,9 @@ async def begin_search_available_phone_numbers( ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities - :param quantity: The quantity of phone numbers in the search. Should be at least 1. - :type quantity: int :keyword str area_code: The area code of the desired phone number, e.g. 425. If not set, any area code could be used in the final search. + :keyword int quantity: The quantity of phone numbers in the search. Default is 1. :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -144,7 +141,7 @@ async def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, - quantity=quantity, + quantity=kwargs.pop('quantity', None), area_code=kwargs.pop('area_code', None) ) return await self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( @@ -171,7 +168,6 @@ async def begin_update_phone_number_capabilities( :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType - :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -199,7 +195,6 @@ async def get_phone_number( :param phone_number: The acquired phone number whose details are to be fetched in E.164 format, e.g. +11234567890. :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber """ return await self._phone_number_client.phone_numbers.get_by_number( diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py index 97f79f4cfdf6..89d33f397a7a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py +++ b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py @@ -17,7 +17,23 @@ def __init__(self, keys=None, replacement="sanitized"): self._replacement = replacement def process_response(self, response): - def sanitize_dict(dictionary): + import json + try: + body = json.loads(response['body']['string']) + if 'phoneNumbers' in body: + for item in body["phoneNumbers"]: + if isinstance(item, str): + body["phoneNumbers"] = [self._replacement] + break + elif "phoneNumber" in item: + item['phoneNumber'] = self._replacement + response['body']['string'] = json.dumps(body) + response['url'] = self._replacement + return response + except (KeyError, ValueError): + return response + + '''def sanitize_dict(dictionary): for key in dictionary: value = dictionary[key] if isinstance(value, str): @@ -30,7 +46,7 @@ def sanitize_dict(dictionary): sanitize_dict(response) - return response + return response''' class BodyReplacerProcessor(RecordingProcessor): """Sanitize the sensitive info inside request or response bodies""" diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index fc085da4f131..0501e2364ffb 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:09:28 GMT + - Fri, 05 Mar 2021 17:31:53 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -26,16 +26,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:09:30 GMT + - Fri, 05 Mar 2021 17:31:55 GMT ms-cv: - - b1QfQvNXJUCmudxXTNXVYw.0 + - 0XgNRxFgsU+jtkYdzUXCig.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1995ms + - 1782ms status: code: 200 message: OK + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index 2d767d98e340..04a6e3c516f1 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:09:31 GMT + - Fri, 05 Mar 2021 17:31:55 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -18,21 +18,41 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: - string: '{"phoneNumbers": ["sanitized"]}' + string: '{"phoneNumbers": [{"id": "16194895581", "phoneNumber": "sanitized", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "Person", "purchaseDate": "2021-01-13T20:01:52.0795301+00:00", + "cost": {"amount": 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "16194895593", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "Person", "purchaseDate": "2021-01-13T20:57:24.5482566+00:00", "cost": {"amount": + 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18332143261", + "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": + "18443281555", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18445492606", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-03-04T19:24:10.3004481+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:09:34 GMT + - Fri, 05 Mar 2021 17:32:00 GMT ms-cv: - - Aa07dXCJ1Eiv8sLy5yURtA.0 + - KdBSgkLB20KwA9de1Xr6AA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 4239ms + - 4581ms status: code: 200 message: OK + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml new file mode 100644 index 000000000000..5c9216ec3237 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml @@ -0,0 +1,67 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "sanitized", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": + "2021-02-09T23:00:10.4372681+00:00", "cost": {"amount": 2.0, "currencyCode": + "USD", "billingFrequency": "Monthly"}}, {"id": "18332272430", "phoneNumber": + "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", + "purchaseDate": "2021-02-09T22:58:41.2504122+00:00", "cost": {"amount": 2.0, + "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18332272445", + "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application", "purchaseDate": "2021-02-09T23:03:57.6969271+00:00", "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": + "18332321209", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T17:51:13.4876763+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332321221", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T17:52:41.818335+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332321226", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T18:01:46.4199999+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18335260208", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2000-01-01T00:00:00+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18336369501", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, + "assignmentType": "Application", "purchaseDate": "2020-09-18T15:03:19.5370985+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 17:57:40 GMT + ms-cv: + - RfWp91uvd02ICqvPQgnxlA.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 5011ms + status: + code: 200 + message: OK + url: sanitized +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml index 927be673d40e..7a1b07c196c2 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 19:00:18 GMT + - Fri, 05 Mar 2021 17:32:00 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,19 +30,19 @@ interactions: content-length: - '0' date: - - Thu, 04 Mar 2021 19:00:21 GMT + - Fri, 05 Mar 2021 17:32:03 GMT ms-cv: - - cnDAlYZUaUq80DHCaL9HkQ.0 + - UiKRXu2IPkmNlhE+PAE0Pg.0 operation-id: - - search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + - search_15d9eb25-3c3e-453d-89c6-0402c6101659 operation-location: - - /phoneNumbers/operations/search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + - /phoneNumbers/operations/search_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 request-context: - appId= search-id: - - bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + - 15d9eb25-3c3e-453d-89c6-0402c6101659 x-processing-time: - - 3170ms + - 2572ms status: code: 202 message: Accepted @@ -56,17 +56,17 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 19:00:52 GMT + - Fri, 05 Mar 2021 17:32:33 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07", - "createdDateTime": "2021-03-04T19:00:21.3580392+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07", + "createdDateTime": "2021-03-05T17:32:03.428505+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -74,18 +74,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 19:00:52 GMT + - Fri, 05 Mar 2021 17:32:33 GMT ms-cv: - - OpIdW4weIEGYzCsOBN5sbA.0 + - yswyogbtVUK6ilnPI2ZPVQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 572ms + - 499ms status: code: 200 message: OK + url: sanitized - request: body: null headers: @@ -96,38 +97,39 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 19:00:52 GMT + - Fri, 05 Mar 2021 17:32:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 response: body: - string: '{"searchId": "bc5ccc45-c46e-4e35-a4cb-b8309e4ef211", "phoneNumbers": - "sanitized", "phoneNumberType": "TollFree", "assignmentType": "Application", + string: '{"searchId": "15d9eb25-3c3e-453d-89c6-0402c6101659", "phoneNumbers": + ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-04T19:16:27.0466380+00:00"}' + "2021-03-05T17:48:09.6152644+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 19:00:53 GMT + - Fri, 05 Mar 2021 17:32:34 GMT ms-cv: - - zyw0LCL7MkiWYMgLtDF7EQ.0 + - nBPsj2RK7UeRMXJw/YYAQA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 957ms + - 959ms status: code: 200 message: OK + url: sanitized - request: - body: '{"searchId": "bc5ccc45-c46e-4e35-a4cb-b8309e4ef211"}' + body: '{"searchId": "15d9eb25-3c3e-453d-89c6-0402c6101659"}' headers: Accept: - application/json @@ -140,7 +142,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 19:00:53 GMT + - Fri, 05 Mar 2021 17:32:35 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -156,19 +158,19 @@ interactions: content-length: - '0' date: - - Thu, 04 Mar 2021 19:00:55 GMT + - Fri, 05 Mar 2021 17:32:37 GMT ms-cv: - - vZooSJe6KkmD8SFNUMVGfg.0 + - HBenQJLrBUuUbCoTX6b96A.0 operation-id: - - purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + - purchase_15d9eb25-3c3e-453d-89c6-0402c6101659 operation-location: - - /phoneNumbers/operations/purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + - /phoneNumbers/operations/purchase_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 purchase-id: - - bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + - 15d9eb25-3c3e-453d-89c6-0402c6101659 request-context: - appId= x-processing-time: - - 2267ms + - 2322ms status: code: 202 message: Accepted @@ -182,34 +184,35 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 19:01:26 GMT + - Fri, 05 Mar 2021 17:33:07 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-03-04T19:00:21.3580392+00:00", "id": "sanitized", "operationType": "Purchase", + "2021-03-05T17:32:03.428505+00:00", "id": "sanitized", "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 19:01:26 GMT + - Fri, 05 Mar 2021 17:33:07 GMT ms-cv: - - jW8zvj4iqkWUwa/mnePf3w.0 + - 2nzsapS2kkSU1CqHHZ4D+Q.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 450ms + - 558ms status: code: 200 message: OK + url: sanitized - request: body: null headers: @@ -222,13 +225,13 @@ interactions: Content-Length: - '0' Date: - - Thu, 04 Mar 2021 19:01:26 GMT + - Fri, 05 Mar 2021 17:33:08 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445499820?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2021-03-07 response: body: string: '' @@ -238,19 +241,19 @@ interactions: content-length: - '0' date: - - Thu, 04 Mar 2021 19:01:27 GMT + - Fri, 05 Mar 2021 17:33:09 GMT ms-cv: - - 3Rh4W/qNvkGW649JaIS4yw.0 + - 8CVr0+mmo06VtKlKCc8pwg.0 operation-id: - - release_eadbe0e5-0ebd-4018-a05f-f4b708480a7d + - release_9f9a864e-f7bb-4b05-b26b-74c1076051f1 operation-location: - - /phoneNumbers/operations/release_eadbe0e5-0ebd-4018-a05f-f4b708480a7d?api-version=2021-03-07 + - /phoneNumbers/operations/release_9f9a864e-f7bb-4b05-b26b-74c1076051f1?api-version=2021-03-07 release-id: - - eadbe0e5-0ebd-4018-a05f-f4b708480a7d + - 9f9a864e-f7bb-4b05-b26b-74c1076051f1 request-context: - appId= x-processing-time: - - 1436ms + - 1449ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml deleted file mode 100644 index aab21e2f175a..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml +++ /dev/null @@ -1,46 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Thu, 04 Mar 2021 17:04:48 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445495681?api-version=2021-03-07 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Operation-Location,operation-id,release-id - content-length: - - '0' - date: - - Thu, 04 Mar 2021 17:04:50 GMT - ms-cv: - - 4M4iMTTkAU2EYlx+U1W1vA.0 - operation-id: - - release_66dd2b9f-0b4d-454f-81b2-4bea870c8740 - operation-location: - - /phoneNumbers/operations/release_66dd2b9f-0b4d-454f-81b2-4bea870c8740?api-version=2021-03-07 - release-id: - - 66dd2b9f-0b4d-454f-81b2-4bea870c8740 - request-context: - - appId= - x-processing-time: - - 1496ms - status: - code: 202 - message: Accepted -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml index bbdc9f05b8b8..5fca591c796b 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 20:09:35 GMT + - Fri, 05 Mar 2021 17:33:09 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,19 +30,19 @@ interactions: content-length: - '0' date: - - Thu, 04 Mar 2021 20:09:38 GMT + - Fri, 05 Mar 2021 17:33:13 GMT ms-cv: - - xp+gSiPZFEi9TrSBlc6j9w.0 + - xUw7Lzf1zEqW60yFP7jeCw.0 operation-id: - - search_c0763b8c-895d-4bba-b312-bcf615a90b2d + - search_324670a6-ab6b-4379-ac4e-8a0af6f374af operation-location: - - /phoneNumbers/operations/search_c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + - /phoneNumbers/operations/search_324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 request-context: - appId= search-id: - - c0763b8c-895d-4bba-b312-bcf615a90b2d + - 324670a6-ab6b-4379-ac4e-8a0af6f374af x-processing-time: - - 3391ms + - 2515ms status: code: 202 message: Accepted @@ -56,17 +56,17 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:10:09 GMT + - Fri, 05 Mar 2021 17:33:42 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07", - "createdDateTime": "2021-03-04T20:09:38.6605579+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07", + "createdDateTime": "2021-03-05T17:33:12.6372497+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -74,18 +74,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:09 GMT + - Fri, 05 Mar 2021 17:33:43 GMT ms-cv: - - WJ4OvgfDfE22EY3w9XwIlA.0 + - pT0wbkG2tk6KY3RAbY7ddA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 483ms + - 294ms status: code: 200 message: OK + url: sanitized - request: body: null headers: @@ -96,34 +97,35 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:10:09 GMT + - Fri, 05 Mar 2021 17:33:43 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 response: body: - string: '{"searchId": "c0763b8c-895d-4bba-b312-bcf615a90b2d", "phoneNumbers": + string: '{"searchId": "324670a6-ab6b-4379-ac4e-8a0af6f374af", "phoneNumbers": ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-04T20:25:44.8545724+00:00"}' + "2021-03-05T17:49:18.9992018+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:10 GMT + - Fri, 05 Mar 2021 17:33:44 GMT ms-cv: - - yGgJPefdTUCTFErjWAngFA.0 + - zFJciOzbiESSdFWHimD7fw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 968ms + - 691ms status: code: 200 message: OK + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml index 45ebf79305c6..eeaa0ef70f11 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Thu, 04 Mar 2021 20:10:10 GMT + - Fri, 05 Mar 2021 17:33:44 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -22,31 +22,32 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 response: body: - string: '{"capabilitiesUpdateId": "c753b8c0-bf2e-4f28-ad44-487b3e55c126"}' + string: '{"capabilitiesUpdateId": "ae9c880c-b537-4538-b260-0f818b21481e"}' headers: access-control-expose-headers: - Operation-Location,Location,operation-id,capabilities-id capabilities-id: - - c753b8c0-bf2e-4f28-ad44-487b3e55c126 + - ae9c880c-b537-4538-b260-0f818b21481e content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:11 GMT + - Fri, 05 Mar 2021 17:33:45 GMT ms-cv: - - nJy2pwvO2kOqoLVJr05Tlg.0 + - GVS3fDhlAkimsjGVwfBIvg.0 operation-id: - - capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126 + - capabilities_ae9c880c-b537-4538-b260-0f818b21481e operation-location: - - /phoneNumbers/operations/capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126?api-version=2021-03-07 + - /phoneNumbers/operations/capabilities_ae9c880c-b537-4538-b260-0f818b21481e?api-version=2021-03-07 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1111ms + - 1149ms status: code: 202 message: Accepted + url: sanitized - request: body: null headers: @@ -57,17 +58,17 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:10:42 GMT + - Fri, 05 Mar 2021 17:34:15 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_ae9c880c-b537-4538-b260-0f818b21481e?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": "/phoneNumbers/+18332143261?api-version=2021-03-07", - "createdDateTime": "2021-03-04T20:10:11.7620886+00:00", "id": "sanitized", + "createdDateTime": "2021-03-05T17:33:45.8891088+00:00", "id": "sanitized", "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -75,18 +76,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:43 GMT + - Fri, 05 Mar 2021 17:34:16 GMT ms-cv: - - bhOOUelnIEioRhByfOIYkQ.0 + - n/+asM0FEUeGb/LSEzp4pQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 2355ms + - 306ms status: code: 200 message: OK + url: sanitized - request: body: null headers: @@ -97,7 +99,7 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:10:44 GMT + - Fri, 05 Mar 2021 17:34:16 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -114,16 +116,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:46 GMT + - Fri, 05 Mar 2021 17:34:18 GMT ms-cv: - - UmM4C4ozVkijkaibJMfTjQ.0 + - uRSIpbt/jUKbaCw7kHXPlg.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 2097ms + - 2022ms status: code: 200 message: OK + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index 4ebae7f27df7..14a00558facd 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Thu, 04 Mar 2021 20:10:46 GMT + - Fri, 05 Mar 2021 17:34:18 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -20,13 +20,13 @@ interactions: "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}' headers: content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 20:10:47 GMT - ms-cv: g+yRryu4o02OCKglJx1kXg.0 + date: Fri, 05 Mar 2021 17:34:21 GMT + ms-cv: U5bV9Vsk/UOitUB2oyKQCA.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 1282ms + x-processing-time: 2642ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/phoneNumbers/%2B18332143261?api-version=2021-03-07 + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index 952d2ff9dc0f..322eddc215fe 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Thu, 04 Mar 2021 20:10:48 GMT + - Fri, 05 Mar 2021 17:34:21 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -14,35 +14,35 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: - string: '{"phoneNumbers": [{"id": "16194895581", "phoneNumber": "+16194895581", + string: '{"phoneNumbers": [{"id": "16194895581", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": "Person", "purchaseDate": "2021-01-13T20:01:52.0795301+00:00", "cost": {"amount": 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, - {"id": "16194895593", "phoneNumber": "+16194895593", "countryCode": "US", - "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": - "none"}, "assignmentType": "Person", "purchaseDate": "2021-01-13T20:57:24.5482566+00:00", - "cost": {"amount": 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, - {"id": "18332143261", "phoneNumber": "+18332143261", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", - "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, - {"id": "18443281555", "phoneNumber": "+18443281555", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": - "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", + {"id": "16194895593", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "Person", "purchaseDate": "2021-01-13T20:57:24.5482566+00:00", "cost": {"amount": + 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18332143261", + "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": + "18443281555", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, - {"id": "18445492606", "phoneNumber": "+18445492606", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2021-03-04T19:24:10.3004481+00:00", + {"id": "18445492606", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-03-04T19:24:10.3004481+00:00", "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' headers: content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 20:10:51 GMT - ms-cv: XvhXXgKui0CweHemAySMfw.0 + date: Fri, 05 Mar 2021 17:34:25 GMT + ms-cv: z+IYJRktqUqBrFrJry0c/w.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 3574ms + x-processing-time: 4036ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml new file mode 100644 index 000000000000..82ff61a3b603 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml @@ -0,0 +1,57 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "sanitized", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": + "2021-02-09T23:00:10.4372681+00:00", "cost": {"amount": 2.0, "currencyCode": + "USD", "billingFrequency": "Monthly"}}, {"id": "18332272430", "phoneNumber": + "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", + "purchaseDate": "2021-02-09T22:58:41.2504122+00:00", "cost": {"amount": 2.0, + "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18332272445", + "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application", "purchaseDate": "2021-02-09T23:03:57.6969271+00:00", "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": + "18332321209", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T17:51:13.4876763+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332321221", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T17:52:41.818335+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332321226", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T18:01:46.4199999+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18335260208", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2000-01-01T00:00:00+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18336369501", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, + "assignmentType": "Application", "purchaseDate": "2020-09-18T15:03:19.5370985+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' + headers: + content-type: application/json; charset=utf-8 + date: Fri, 05 Mar 2021 17:58:17 GMT + ms-cv: xYZEMY9Gj0y/qud0smN4KA.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 6189ms + status: + code: 200 + message: OK + url: sanitized +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml deleted file mode 100644 index 23a9450384fa..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml +++ /dev/null @@ -1,25 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 - response: - body: - string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' - headers: - content-type: application/json - date: Thu, 04 Mar 2021 18:16:08 GMT - ms-cv: SyFWaYd1okyG+rITVB0DKQ.0 - request-context: appId= - transfer-encoding: chunked - x-processing-time: 177ms - status: - code: 401 - message: Unauthorized - url: https://live-testing.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml index 367ebfae0896..45564a427e4a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 18:17:42 GMT + - Fri, 05 Mar 2021 17:34:25 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,13 +23,13 @@ interactions: headers: access-control-expose-headers: Location,Operation-Location,operation-id,search-id content-length: '0' - date: Thu, 04 Mar 2021 18:17:45 GMT - ms-cv: /9Dp1W9J10W5ZzyvLykP6g.0 - operation-id: search_a061a85c-c652-44d8-b051-014b8d892a07 - operation-location: /phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + date: Fri, 05 Mar 2021 17:34:28 GMT + ms-cv: Bi0spXFiXE+wBTBjBbNF2Q.0 + operation-id: search_21a51537-3995-4974-a2d7-e6b87dadce2a + operation-location: /phoneNumbers/operations/search_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 request-context: appId= - search-id: a061a85c-c652-44d8-b051-014b8d892a07 - x-processing-time: 3200ms + search-id: 21a51537-3995-4974-a2d7-e6b87dadce2a + x-processing-time: 2724ms status: code: 202 message: Accepted @@ -38,61 +38,61 @@ interactions: body: '' headers: Date: - - Thu, 04 Mar 2021 18:18:15 GMT + - Fri, 05 Mar 2021 17:34:58 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07", - "createdDateTime": "2021-03-04T18:17:45.1869951+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07", + "createdDateTime": "2021-03-05T17:34:28.9687105+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: Location content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 18:18:15 GMT - ms-cv: An9SG0xNA02+nCEJ2iyPGg.0 + date: Fri, 05 Mar 2021 17:34:59 GMT + ms-cv: moro0LSAOUe8lq83MXbvPw.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 559ms + x-processing-time: 570ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + url: sanitized - request: body: '' headers: Date: - - Thu, 04 Mar 2021 18:18:16 GMT + - Fri, 05 Mar 2021 17:34:59 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 response: body: - string: '{"searchId": "a061a85c-c652-44d8-b051-014b8d892a07", "phoneNumbers": - ["+18445496587"], "phoneNumberType": "TollFree", "assignmentType": "Application", + string: '{"searchId": "21a51537-3995-4974-a2d7-e6b87dadce2a", "phoneNumbers": + ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-04T18:33:53.9609193+00:00"}' + "2021-03-05T17:50:34.9533619+00:00"}' headers: content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 18:18:17 GMT - ms-cv: tajtINiuYU6xpPdp0AwTzA.0 + date: Fri, 05 Mar 2021 17:35:01 GMT + ms-cv: c0t2UOUpo0y74f3dLa9Mcw.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 1571ms + x-processing-time: 1205ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + url: sanitized - request: - body: '{"searchId": "a061a85c-c652-44d8-b051-014b8d892a07"}' + body: '{"searchId": "21a51537-3995-4974-a2d7-e6b87dadce2a"}' headers: Accept: - application/json @@ -101,7 +101,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 18:18:18 GMT + - Fri, 05 Mar 2021 17:35:01 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -114,13 +114,13 @@ interactions: headers: access-control-expose-headers: Operation-Location,operation-id,purchase-id content-length: '0' - date: Thu, 04 Mar 2021 18:18:20 GMT - ms-cv: cfO6OqU0F0SdpnnF3G0Qxg.0 - operation-id: purchase_a061a85c-c652-44d8-b051-014b8d892a07 - operation-location: /phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 - purchase-id: a061a85c-c652-44d8-b051-014b8d892a07 + date: Fri, 05 Mar 2021 17:35:03 GMT + ms-cv: cwr5L3s6sESZzNYi0shhsg.0 + operation-id: purchase_21a51537-3995-4974-a2d7-e6b87dadce2a + operation-location: /phoneNumbers/operations/purchase_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 + purchase-id: 21a51537-3995-4974-a2d7-e6b87dadce2a request-context: appId= - x-processing-time: 2228ms + x-processing-time: 2201ms status: code: 202 message: Accepted @@ -129,57 +129,57 @@ interactions: body: '' headers: Date: - - Thu, 04 Mar 2021 18:18:50 GMT + - Fri, 05 Mar 2021 17:35:33 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-03-04T18:17:45.1869951+00:00", "id": "sanitized", "operationType": "Purchase", + "2021-03-05T17:34:28.9687105+00:00", "id": "sanitized", "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 18:18:50 GMT - ms-cv: 2BX6oEo9cEOkNVEY8GJghg.0 + date: Fri, 05 Mar 2021 17:35:34 GMT + ms-cv: RYddi1AflE69nYIk0rXmAQ.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 530ms + x-processing-time: 491ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + url: sanitized - request: body: '' headers: Accept: - application/json Date: - - Thu, 04 Mar 2021 18:18:51 GMT + - Fri, 05 Mar 2021 17:35:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445496587?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2021-03-07 response: body: string: '' headers: access-control-expose-headers: Operation-Location,operation-id,release-id content-length: '0' - date: Thu, 04 Mar 2021 18:18:51 GMT - ms-cv: nPiFBK6ha02zRzkcjIkNwA.0 - operation-id: release_4427e952-844b-4d4a-9830-774e2b588066 - operation-location: /phoneNumbers/operations/release_4427e952-844b-4d4a-9830-774e2b588066?api-version=2021-03-07 - release-id: 4427e952-844b-4d4a-9830-774e2b588066 + date: Fri, 05 Mar 2021 17:35:35 GMT + ms-cv: jfGHX2rOTU+YERN3l8Gruw.0 + operation-id: release_f5bd3fc8-e53f-40f3-b63b-d66d68f76f40 + operation-location: /phoneNumbers/operations/release_f5bd3fc8-e53f-40f3-b63b-d66d68f76f40?api-version=2021-03-07 + release-id: f5bd3fc8-e53f-40f3-b63b-d66d68f76f40 request-context: appId= - x-processing-time: 872ms + x-processing-time: 1503ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/phoneNumbers/%2B18445496587?api-version=2021-03-07 + url: https://live-testing.communication.azure.com/phoneNumbers/%2B18447304825?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml index dc596a27a626..37907a99490f 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 20:10:52 GMT + - Fri, 05 Mar 2021 17:35:36 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,13 +23,13 @@ interactions: headers: access-control-expose-headers: Location,Operation-Location,operation-id,search-id content-length: '0' - date: Thu, 04 Mar 2021 20:10:54 GMT - ms-cv: 8WLGSUfKPU6zyEk9ShCZmw.0 - operation-id: search_d2b92f7d-1c61-481c-ac7d-044754b422bb - operation-location: /phoneNumbers/operations/search_d2b92f7d-1c61-481c-ac7d-044754b422bb?api-version=2021-03-07 + date: Fri, 05 Mar 2021 17:35:39 GMT + ms-cv: OtXGmscJ8EmKsbecqjaAag.0 + operation-id: search_7f99cec8-7846-4159-b200-3c536909c7da + operation-location: /phoneNumbers/operations/search_7f99cec8-7846-4159-b200-3c536909c7da?api-version=2021-03-07 request-context: appId= - search-id: d2b92f7d-1c61-481c-ac7d-044754b422bb - x-processing-time: 2876ms + search-id: 7f99cec8-7846-4159-b200-3c536909c7da + x-processing-time: 2811ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml index 46e9b930efed..676f2d9ff5b7 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Thu, 04 Mar 2021 20:10:55 GMT + - Fri, 05 Mar 2021 17:35:39 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -18,20 +18,20 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 response: body: - string: '{"capabilitiesUpdateId": "a51ebf71-91f5-4410-917a-1d3993e8d7ae"}' + string: '{"capabilitiesUpdateId": "162b8e8d-b692-41ab-bbf8-9fffd289710e"}' headers: access-control-expose-headers: Operation-Location,Location,operation-id,capabilities-id - capabilities-id: a51ebf71-91f5-4410-917a-1d3993e8d7ae + capabilities-id: 162b8e8d-b692-41ab-bbf8-9fffd289710e content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 20:10:56 GMT - ms-cv: nQRrDvDF9kSmUHvSW2nJNw.0 - operation-id: capabilities_a51ebf71-91f5-4410-917a-1d3993e8d7ae - operation-location: /phoneNumbers/operations/capabilities_a51ebf71-91f5-4410-917a-1d3993e8d7ae?api-version=2021-03-07 + date: Fri, 05 Mar 2021 17:35:40 GMT + ms-cv: xnZ+QUgohUWXJmu2IYvDAw.0 + operation-id: capabilities_162b8e8d-b692-41ab-bbf8-9fffd289710e + operation-location: /phoneNumbers/operations/capabilities_162b8e8d-b692-41ab-bbf8-9fffd289710e?api-version=2021-03-07 request-context: appId= transfer-encoding: chunked - x-processing-time: 1183ms + x-processing-time: 1088ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/phoneNumbers/%2B18332143261/capabilities?api-version=2021-03-07 + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 67f4d51a526c..891240a0227e 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -10,31 +10,28 @@ SKIP_PURCHASE_PHONE_NUMBER_TESTS = True PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers shouldn't be purchased in live tests" -class NewTests(CommunicationTestCase): +class PhoneNumbersAdministrationClientTest(CommunicationTestCase): def setUp(self): - super(NewTests, self).setUp() + super(PhoneNumbersAdministrationClientTest, self).setUp() if self.is_playback(): self.phone_number = "sanitized" self.country_code = "US" - self.area_code = "833" else: self.phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") - self.phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE") - self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") - self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") + self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE", "US") self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( keys=["id", "token", "phoneNumber"] ), - PhoneNumberUriReplacer()]) + PhoneNumberUriReplacer(), + ResponseReplacerProcessor()]) - @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_all_phone_numbers_from_managed_identity(self): + def test_list_acquired_phone_numbers_from_managed_identity(self): endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() phone_number_client = PhoneNumbersClient(endpoint, credential) - phone_numbers = phone_number_client.list_all_phone_numbers() + phone_numbers = phone_number_client.list_acquired_phone_numbers() assert phone_numbers.next() def test_list_acquired_phone_numbers(self): @@ -55,7 +52,6 @@ def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code=self.area_code, polling = True ) assert poller.result() @@ -80,7 +76,6 @@ def test_purchase_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code=self.area_code, polling = True ) phone_number_to_buy = search_poller.result() diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index a2f049c6e1e6..dbea44a7db7d 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -11,30 +11,25 @@ SKIP_PURCHASE_PHONE_NUMBER_TESTS = True PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers shouldn't be purchased in live tests" -class NewTests(AsyncCommunicationTestCase): +class PhoneNumbersAdministrationClientTestAsync(AsyncCommunicationTestCase): def setUp(self): - super(NewTests, self).setUp() + super(PhoneNumbersAdministrationClientTestAsync, self).setUp() if self.is_playback(): - self.phone_number = "+18000005555" - self.phone_number_to_release = "+18000005556" + self.phone_number = "sanitized" self.country_code = "US" - self.area_code = "833" else: self.phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") - self.phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE") - self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") - self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") - + self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE", "US") self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=["id", "token", "phoneNumber", "phonenumbers"] + keys=["id", "token", "phoneNumber"] ), - PhoneNumberUriReplacer()]) + PhoneNumberUriReplacer(), + ResponseReplacerProcessor()]) - @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) @AsyncCommunicationTestCase.await_prepared_test - async def test_list_all_phone_numbers_from_managed_identity(self): + async def test_list_acquired_phone_numbers_from_managed_identity(self): endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() phone_number_client = PhoneNumbersClient(endpoint, credential) @@ -72,7 +67,6 @@ async def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code=self.area_code, polling = True ) assert poller.result() @@ -101,7 +95,6 @@ async def test_purchase_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code=self.area_code, polling = True ) phone_number_to_buy = await search_poller.result()