Skip to content

Commit 8991c0a

Browse files
[Communication]: Updated test_search_available_phone_numbers_with_invalid_country_code async test to be consistent with sync test (#18466)
1 parent 7de1d68 commit 8991c0a

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
interactions:
2+
- request:
3+
body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities":
4+
{"calling": "inbound", "sms": "inbound+outbound"}}'
5+
headers:
6+
Accept:
7+
- application/json
8+
Content-Length:
9+
- '131'
10+
Content-Type:
11+
- application/json
12+
Date:
13+
- Fri, 30 Apr 2021 21:35:58 GMT
14+
User-Agent:
15+
- azsdk-python-communication-phonenumbers/1.0.1 Python/3.9.0 (Windows-10-10.0.19041-SP0)
16+
x-ms-return-client-request-id:
17+
- 'true'
18+
method: POST
19+
uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/XX/:search?api-version=2021-03-07
20+
response:
21+
body:
22+
string: '{"error": {"code": "InvalidInput", "message": "Unable to parse country
23+
code.", "target": "countrycode"}}'
24+
headers:
25+
api-supported-versions: '2021-03-07'
26+
content-type: application/json
27+
date: Fri, 30 Apr 2021 21:35:58 GMT
28+
ms-cv: vS+4qpNfgUqjc0RGNA/ZgQ.0
29+
request-context: appId=
30+
transfer-encoding: chunked
31+
x-processing-time: 33ms
32+
status:
33+
code: 400
34+
message: Bad Request
35+
url: sanitized
36+
version: 1

sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ async def test_get_purchased_phone_number_with_invalid_phone_number(self):
226226
assert ex.value.message is not None
227227

228228
@AsyncCommunicationTestCase.await_prepared_test
229-
async def test_search_available_phone_numbers_with_no_country_code(self):
229+
async def test_search_available_phone_numbers_with_invalid_country_code(self):
230230
capabilities = PhoneNumberCapabilities(
231231
calling = PhoneNumberCapabilityType.INBOUND,
232232
sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND
@@ -235,7 +235,7 @@ async def test_search_available_phone_numbers_with_no_country_code(self):
235235
with pytest.raises(Exception) as ex:
236236
async with self.phone_number_client:
237237
await self.phone_number_client.begin_search_available_phone_numbers(
238-
None,
238+
"XX",
239239
PhoneNumberType.TOLL_FREE,
240240
PhoneNumberAssignmentType.APPLICATION,
241241
capabilities,

0 commit comments

Comments
 (0)