Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
SKIP_INT_PHONE_NUMBER_TESTS = os.getenv("COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", "false") == "true"
INT_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers setting SMS capability does not support in INT. Skip these tests in INT."

SKIP_UPDATE_CAPABILITIES_TESTS = os.getenv("COMMUNICATION_SKIP_CAPABILITIES_LIVE_TEST", "false") == "true"
SKIP_UPDATE_CAPABILITIES_TESTS_REASON = "Phone number capabilities update does not currently support parallel execution. Skip these tests from live test pipeline."

class PhoneNumbersClientTest(CommunicationTestCase):
def setUp(self):
super(PhoneNumbersClientTest, self).setUp()
Expand Down Expand Up @@ -110,6 +113,7 @@ def test_search_available_phone_numbers(self):
assert poller.result()

@pytest.mark.skipif(SKIP_INT_PHONE_NUMBER_TESTS, reason=INT_PHONE_NUMBER_TEST_SKIP_REASON)
@pytest.mark.skipif(SKIP_UPDATE_CAPABILITIES_TESTS, reason=SKIP_UPDATE_CAPABILITIES_TESTS_REASON)
def test_update_phone_number_capabilities_from_managed_identity(self):
endpoint, access_key = parse_connection_str(self.connection_str)
credential = create_token_credential()
Expand All @@ -131,6 +135,7 @@ def test_update_phone_number_capabilities_from_managed_identity(self):
assert poller.status() == PhoneNumberOperationStatus.SUCCEEDED.value

@pytest.mark.skipif(SKIP_INT_PHONE_NUMBER_TESTS, reason=INT_PHONE_NUMBER_TEST_SKIP_REASON)
@pytest.mark.skipif(SKIP_UPDATE_CAPABILITIES_TESTS, reason=SKIP_UPDATE_CAPABILITIES_TESTS_REASON)
def test_update_phone_number_capabilities(self):
current_phone_number = self.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
SKIP_INT_PHONE_NUMBER_TESTS = os.getenv("COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", "false") == "true"
INT_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers setting SMS capability does not support in INT. Skip these tests in INT."

SKIP_UPDATE_CAPABILITIES_TESTS = os.getenv("COMMUNICATION_SKIP_CAPABILITIES_LIVE_TEST", "false") == "true"
SKIP_UPDATE_CAPABILITIES_TESTS_REASON = "Phone number capabilities update does not currently support parallel execution. Skip these tests from live test pipeline."

class PhoneNumbersClientTestAsync(AsyncCommunicationTestCase):
def setUp(self):
super(PhoneNumbersClientTestAsync, self).setUp()
Expand Down Expand Up @@ -129,6 +132,7 @@ async def test_search_available_phone_numbers(self):
assert poller.result()

@pytest.mark.skipif(SKIP_INT_PHONE_NUMBER_TESTS, reason=INT_PHONE_NUMBER_TEST_SKIP_REASON)
@pytest.mark.skipif(SKIP_UPDATE_CAPABILITIES_TESTS, reason=SKIP_UPDATE_CAPABILITIES_TESTS_REASON)
@AsyncCommunicationTestCase.await_prepared_test
async def test_update_phone_number_capabilities(self):
async with self.phone_number_client:
Expand All @@ -145,6 +149,7 @@ async def test_update_phone_number_capabilities(self):
assert poller.status() == PhoneNumberOperationStatus.SUCCEEDED.value

@pytest.mark.skipif(SKIP_INT_PHONE_NUMBER_TESTS, reason=INT_PHONE_NUMBER_TEST_SKIP_REASON)
@pytest.mark.skipif(SKIP_UPDATE_CAPABILITIES_TESTS, reason=SKIP_UPDATE_CAPABILITIES_TESTS_REASON)
@AsyncCommunicationTestCase.await_prepared_test
async def test_update_phone_number_capabilities_from_managed_identity(self):
endpoint, access_key = parse_connection_str(self.connection_str)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ stages:
- $(sub-config-communication-int-test-resources-common)
- $(sub-config-communication-int-test-resources-python)
Clouds: Public,Int
EnvVars:
COMMUNICATION_SKIP_CAPABILITIES_LIVE_TEST: true