Exemplo n.º 1
0
 def test_get_purchased_phone_number_from_managed_identity(self):
     endpoint, access_key = parse_connection_str(self.connection_str)
     credential = create_token_credential()
     phone_number_client = PhoneNumbersClient(endpoint, credential)
     phone_number = phone_number_client.get_purchased_phone_number(
         self.phone_number)
     assert phone_number.phone_number == self.phone_number
Exemplo n.º 2
0
 def test_update_phone_number_capabilities_from_managed_identity(self):
     endpoint, access_key = parse_connection_str(self.connection_str)
     credential = create_token_credential()
     phone_number_client = PhoneNumbersClient(
         endpoint,
         credential,
         http_logging_policy=get_http_logging_policy())
     current_phone_number = phone_number_client.get_purchased_phone_number(
         self.phone_number)
     calling_capabilities = PhoneNumberCapabilityType.INBOUND if current_phone_number.capabilities.calling == PhoneNumberCapabilityType.OUTBOUND else PhoneNumberCapabilityType.OUTBOUND
     sms_capabilities = PhoneNumberCapabilityType.INBOUND_OUTBOUND if current_phone_number.capabilities.sms == PhoneNumberCapabilityType.OUTBOUND else PhoneNumberCapabilityType.OUTBOUND
     poller = phone_number_client.begin_update_phone_number_capabilities(
         self.phone_number,
         sms_capabilities,
         calling_capabilities,
         polling=True)
     assert poller.result()
     assert poller.status() == PhoneNumberOperationStatus.SUCCEEDED.value