Skip to content

[Communication]: Updated test_search_available_phone_numbers_with_invalid_country_code async test to be consistent with sync test #18466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2021
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
@@ -0,0 +1,36 @@
interactions:
- request:
body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities":
{"calling": "inbound", "sms": "inbound+outbound"}}'
headers:
Accept:
- application/json
Content-Length:
- '131'
Content-Type:
- application/json
Date:
- Fri, 30 Apr 2021 21:35:58 GMT
User-Agent:
- azsdk-python-communication-phonenumbers/1.0.1 Python/3.9.0 (Windows-10-10.0.19041-SP0)
x-ms-return-client-request-id:
- 'true'
method: POST
uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/XX/:search?api-version=2021-03-07
response:
body:
string: '{"error": {"code": "InvalidInput", "message": "Unable to parse country
code.", "target": "countrycode"}}'
headers:
api-supported-versions: '2021-03-07'
content-type: application/json
date: Fri, 30 Apr 2021 21:35:58 GMT
ms-cv: vS+4qpNfgUqjc0RGNA/ZgQ.0
request-context: appId=
transfer-encoding: chunked
x-processing-time: 33ms
status:
code: 400
message: Bad Request
url: sanitized
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async def test_get_purchased_phone_number_with_invalid_phone_number(self):
assert ex.value.message is not None

@AsyncCommunicationTestCase.await_prepared_test
async def test_search_available_phone_numbers_with_no_country_code(self):
async def test_search_available_phone_numbers_with_invalid_country_code(self):
capabilities = PhoneNumberCapabilities(
calling = PhoneNumberCapabilityType.INBOUND,
sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND
Expand All @@ -235,7 +235,7 @@ async def test_search_available_phone_numbers_with_no_country_code(self):
with pytest.raises(Exception) as ex:
async with self.phone_number_client:
await self.phone_number_client.begin_search_available_phone_numbers(
None,
"XX",
PhoneNumberType.TOLL_FREE,
PhoneNumberAssignmentType.APPLICATION,
capabilities,
Expand Down