Skip to content

Commit b950e8b

Browse files
[Communication] - Phone Numbers - Use static connection string in azure-communication-phonenumber tests (#26775)
* Use static connection string in phonenumber tests * Use static connection string for SIP tests
1 parent 6be8beb commit b950e8b

File tree

25 files changed

+428
-384
lines changed

25 files changed

+428
-384
lines changed

sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ def setUp(self):
8888
if self.is_playback():
8989
self.connection_str = "endpoint=https://sanitized.communication.azure.com/;accesskey=fake==="
9090
else:
91-
self.connection_str = os.getenv('COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING') or \
92-
os.getenv('COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING')
91+
self.connection_str = os.getenv('COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING')
9392
endpoint, _ = parse_connection_str(self.connection_str)
9493
self._resource_name = endpoint.split(".")[0]
9594
self.scrubber.register_name_pair(self._resource_name, "sanitized")

sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_purchased_phone_number.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,36 @@ interactions:
99
Connection:
1010
- keep-alive
1111
User-Agent:
12-
- azsdk-python-communication-phonenumbers/1.0.2 Python/3.9.9 (Windows-10-10.0.22000-SP0)
12+
- azsdk-python-communication-phonenumbers/1.1.0b3 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)
1313
x-ms-date:
14-
- Wed, 12 Jan 2022 16:24:18 GMT
14+
- Wed, 12 Oct 2022 01:00:59 GMT
1515
x-ms-return-client-request-id:
1616
- 'true'
1717
method: GET
1818
uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2022-01-11-preview2
1919
response:
2020
body:
2121
string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US",
22-
"phoneNumberType": "tollFree", "capabilities": {"calling": "inbound", "sms":
22+
"phoneNumberType": "tollFree", "capabilities": {"calling": "none", "sms":
2323
"outbound"}, "assignmentType": "application", "purchaseDate": "2021-06-23T23:38:41.0997634+00:00",
2424
"cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "monthly"}}'
2525
headers:
2626
api-supported-versions:
27-
- 2021-03-07, 2022-01-11-preview2
27+
- 2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01
2828
content-type:
2929
- application/json; charset=utf-8
3030
date:
31-
- Wed, 12 Jan 2022 16:24:17 GMT
31+
- Wed, 12 Oct 2022 01:01:01 GMT
3232
ms-cv:
33-
- RUviUhanXUuedvHl+aoPpg.0
34-
request-context:
35-
- appId=
33+
- CmoReVse+UaDMfLQ3HYBAQ.0
34+
strict-transport-security:
35+
- max-age=2592000
3636
transfer-encoding:
3737
- chunked
3838
x-cache:
3939
- CONFIG_NOCACHE
4040
x-processing-time:
41-
- 3192ms
41+
- 1646ms
4242
status:
4343
code: 200
4444
message: OK

sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_purchased_phone_number_from_managed_identity.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ interactions:
99
Connection:
1010
- keep-alive
1111
User-Agent:
12-
- azsdk-python-communication-phonenumbers/1.0.2 Python/3.9.9 (Windows-10-10.0.22000-SP0)
12+
- azsdk-python-communication-phonenumbers/1.1.0b3 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)
1313
method: GET
1414
uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2022-01-11-preview2
1515
response:
1616
body:
1717
string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US",
18-
"phoneNumberType": "tollFree", "capabilities": {"calling": "inbound", "sms":
18+
"phoneNumberType": "tollFree", "capabilities": {"calling": "none", "sms":
1919
"outbound"}, "assignmentType": "application", "purchaseDate": "2021-06-23T23:38:41.0997634+00:00",
2020
"cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "monthly"}}'
2121
headers:
2222
api-supported-versions:
23-
- 2021-03-07, 2022-01-11-preview2
23+
- 2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01
2424
content-type:
2525
- application/json; charset=utf-8
2626
date:
27-
- Wed, 12 Jan 2022 16:24:22 GMT
27+
- Wed, 12 Oct 2022 01:01:03 GMT
2828
ms-cv:
29-
- vyQH496Y/0OFVUm/apv27Q.0
30-
request-context:
31-
- appId=
29+
- G0yrk9BudEKWDdQjKoMpgA.0
30+
strict-transport-security:
31+
- max-age=2592000
3232
transfer-encoding:
3333
- chunked
3434
x-cache:
3535
- CONFIG_NOCACHE
3636
x-processing-time:
37-
- 3489ms
37+
- 1398ms
3838
status:
3939
code: 200
4040
message: OK

sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_purchased_phone_number_with_invalid_phone_number.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ interactions:
99
Connection:
1010
- keep-alive
1111
User-Agent:
12-
- azsdk-python-communication-phonenumbers/1.0.2 Python/3.9.9 (Windows-10-10.0.22000-SP0)
12+
- azsdk-python-communication-phonenumbers/1.1.0b3 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)
1313
x-ms-date:
14-
- Wed, 12 Jan 2022 16:24:27 GMT
14+
- Wed, 12 Oct 2022 01:01:03 GMT
1515
x-ms-return-client-request-id:
1616
- 'true'
1717
method: GET
@@ -22,21 +22,21 @@ interactions:
2222
cannot be found.", "target": "phonenumber"}}'
2323
headers:
2424
api-supported-versions:
25-
- 2021-03-07, 2022-01-11-preview2
25+
- 2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01
2626
content-type:
2727
- application/json
2828
date:
29-
- Wed, 12 Jan 2022 16:24:25 GMT
29+
- Wed, 12 Oct 2022 01:01:04 GMT
3030
ms-cv:
31-
- eRnvsvQ0s0ymZOrVnZ56wQ.0
32-
request-context:
33-
- appId=
31+
- /gpFm/xhKEKUwge+13cKKQ.0
32+
strict-transport-security:
33+
- max-age=2592000
3434
transfer-encoding:
3535
- chunked
3636
x-cache:
3737
- CONFIG_NOCACHE
3838
x-processing-time:
39-
- 1712ms
39+
- 664ms
4040
status:
4141
code: 404
4242
message: Not Found

sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_purchased_phone_numbers.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ interactions:
99
Connection:
1010
- keep-alive
1111
User-Agent:
12-
- azsdk-python-communication-phonenumbers/1.0.2 Python/3.9.9 (Windows-10-10.0.22000-SP0)
12+
- azsdk-python-communication-phonenumbers/1.1.0b3 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)
1313
x-ms-date:
14-
- Wed, 12 Jan 2022 16:24:30 GMT
14+
- Wed, 12 Oct 2022 01:01:04 GMT
1515
x-ms-return-client-request-id:
1616
- 'true'
1717
method: GET
@@ -199,7 +199,7 @@ interactions:
199199
"assignmentType": "application", "purchaseDate": "2021-06-23T23:41:22.1720088+00:00",
200200
"cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "monthly"}},
201201
{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType":
202-
"tollFree", "capabilities": {"calling": "inbound", "sms": "outbound"}, "assignmentType":
202+
"tollFree", "capabilities": {"calling": "none", "sms": "outbound"}, "assignmentType":
203203
"application", "purchaseDate": "2021-06-23T23:38:41.0997634+00:00", "cost":
204204
{"amount": 2.0, "currencyCode": "USD", "billingFrequency": "monthly"}}, {"id":
205205
"sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType":
@@ -421,21 +421,21 @@ interactions:
421421
"nextLink": "/phoneNumbers?skip=100&top=100&api-version=2022-01-11-preview2"}'
422422
headers:
423423
api-supported-versions:
424-
- 2021-03-07, 2022-01-11-preview2
424+
- 2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01
425425
content-type:
426426
- application/json; charset=utf-8
427427
date:
428-
- Wed, 12 Jan 2022 16:24:31 GMT
428+
- Wed, 12 Oct 2022 01:01:09 GMT
429429
ms-cv:
430-
- uncxAwNo6UCrwN7VxlhXCQ.0
431-
request-context:
432-
- appId=
430+
- mBVgKYRrpEmdgx61MQF9xQ.0
431+
strict-transport-security:
432+
- max-age=2592000
433433
transfer-encoding:
434434
- chunked
435435
x-cache:
436436
- CONFIG_NOCACHE
437437
x-processing-time:
438-
- 4822ms
438+
- 4322ms
439439
status:
440440
code: 200
441441
message: OK

sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_purchased_phone_numbers_from_managed_identity.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interactions:
99
Connection:
1010
- keep-alive
1111
User-Agent:
12-
- azsdk-python-communication-phonenumbers/1.0.2 Python/3.9.9 (Windows-10-10.0.22000-SP0)
12+
- azsdk-python-communication-phonenumbers/1.1.0b3 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)
1313
method: GET
1414
uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2022-01-11-preview2
1515
response:
@@ -195,7 +195,7 @@ interactions:
195195
"assignmentType": "application", "purchaseDate": "2021-06-23T23:41:22.1720088+00:00",
196196
"cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "monthly"}},
197197
{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType":
198-
"tollFree", "capabilities": {"calling": "inbound", "sms": "outbound"}, "assignmentType":
198+
"tollFree", "capabilities": {"calling": "none", "sms": "outbound"}, "assignmentType":
199199
"application", "purchaseDate": "2021-06-23T23:38:41.0997634+00:00", "cost":
200200
{"amount": 2.0, "currencyCode": "USD", "billingFrequency": "monthly"}}, {"id":
201201
"sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType":
@@ -417,21 +417,21 @@ interactions:
417417
"nextLink": "/phoneNumbers?skip=100&top=100&api-version=2022-01-11-preview2"}'
418418
headers:
419419
api-supported-versions:
420-
- 2021-03-07, 2022-01-11-preview2
420+
- 2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01
421421
content-type:
422422
- application/json; charset=utf-8
423423
date:
424-
- Wed, 12 Jan 2022 16:24:40 GMT
424+
- Wed, 12 Oct 2022 01:01:15 GMT
425425
ms-cv:
426-
- WlkpBqUX40yEpeTVct8OPg.0
427-
request-context:
428-
- appId=
426+
- SXSxZMQlL0ezI0szYhCEvg.0
427+
strict-transport-security:
428+
- max-age=2592000
429429
transfer-encoding:
430430
- chunked
431431
x-cache:
432432
- CONFIG_NOCACHE
433433
x-processing-time:
434-
- 7286ms
434+
- 5185ms
435435
status:
436436
code: 200
437437
message: OK

sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml

+33-33
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ interactions:
1414
Content-Type:
1515
- application/json
1616
User-Agent:
17-
- azsdk-python-communication-phonenumbers/1.0.2 Python/3.9.9 (Windows-10-10.0.22000-SP0)
17+
- azsdk-python-communication-phonenumbers/1.1.0b3 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)
1818
x-ms-date:
19-
- Wed, 12 Jan 2022 16:24:45 GMT
19+
- Wed, 12 Oct 2022 01:01:14 GMT
2020
x-ms-return-client-request-id:
2121
- 'true'
2222
method: POST
@@ -28,25 +28,25 @@ interactions:
2828
access-control-expose-headers:
2929
- Location,Operation-Location,operation-id,search-id
3030
api-supported-versions:
31-
- 2021-03-07, 2022-01-11-preview2
31+
- 2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01
3232
content-length:
3333
- '0'
3434
date:
35-
- Wed, 12 Jan 2022 16:24:47 GMT
35+
- Wed, 12 Oct 2022 01:01:35 GMT
3636
ms-cv:
37-
- 8tw5TPAY2UWd5E7y6FEjKQ.0
37+
- Lija3zCczEWL9xrP1DQopQ.0
3838
operation-id:
39-
- search_e1784c92-5251-4e28-af6c-8a7566d6cd33
39+
- search_2553f1fa-fdf2-40d9-b3aa-d867515b04b7
4040
operation-location:
41-
- /phoneNumbers/operations/search_e1784c92-5251-4e28-af6c-8a7566d6cd33?api-version=2022-01-11-preview2
42-
request-context:
43-
- appId=
41+
- /phoneNumbers/operations/search_2553f1fa-fdf2-40d9-b3aa-d867515b04b7?api-version=2022-01-11-preview2
4442
search-id:
45-
- e1784c92-5251-4e28-af6c-8a7566d6cd33
43+
- 2553f1fa-fdf2-40d9-b3aa-d867515b04b7
44+
strict-transport-security:
45+
- max-age=2592000
4646
x-cache:
4747
- CONFIG_NOCACHE
4848
x-processing-time:
49-
- 4862ms
49+
- 20599ms
5050
status:
5151
code: 202
5252
message: Accepted
@@ -60,38 +60,38 @@ interactions:
6060
Connection:
6161
- keep-alive
6262
User-Agent:
63-
- azsdk-python-communication-phonenumbers/1.0.2 Python/3.9.9 (Windows-10-10.0.22000-SP0)
63+
- azsdk-python-communication-phonenumbers/1.1.0b3 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)
6464
x-ms-date:
65-
- Wed, 12 Jan 2022 16:25:21 GMT
65+
- Wed, 12 Oct 2022 01:02:05 GMT
6666
x-ms-return-client-request-id:
6767
- 'true'
6868
method: GET
69-
uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_e1784c92-5251-4e28-af6c-8a7566d6cd33?api-version=2022-01-11-preview2
69+
uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_2553f1fa-fdf2-40d9-b3aa-d867515b04b7?api-version=2022-01-11-preview2
7070
response:
7171
body:
7272
string: '{"operationType": "search", "status": "succeeded", "resourceLocation":
73-
"/availablePhoneNumbers/searchResults/e1784c92-5251-4e28-af6c-8a7566d6cd33?api-version=2022-01-11-preview2",
74-
"createdDateTime": "2022-01-12T16:24:46.0297367+00:00", "id": "sanitized",
73+
"/availablePhoneNumbers/searchResults/2553f1fa-fdf2-40d9-b3aa-d867515b04b7?api-version=2022-01-11-preview2",
74+
"createdDateTime": "2022-10-12T01:01:35.4752168+00:00", "id": "sanitized",
7575
"lastActionDateTime": "0001-01-01T00:00:00+00:00"}'
7676
headers:
7777
access-control-expose-headers:
7878
- Location
7979
api-supported-versions:
80-
- 2021-03-07, 2022-01-11-preview2
80+
- 2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01
8181
content-type:
8282
- application/json; charset=utf-8
8383
date:
84-
- Wed, 12 Jan 2022 16:25:18 GMT
84+
- Wed, 12 Oct 2022 01:02:06 GMT
8585
ms-cv:
86-
- ChuaJbw9x0aeoEex20Zetg.0
87-
request-context:
88-
- appId=
86+
- GBk8bcqy20+tx4hDyTjYaA.0
87+
strict-transport-security:
88+
- max-age=2592000
8989
transfer-encoding:
9090
- chunked
9191
x-cache:
9292
- CONFIG_NOCACHE
9393
x-processing-time:
94-
- 1361ms
94+
- 628ms
9595
status:
9696
code: 200
9797
message: OK
@@ -106,37 +106,37 @@ interactions:
106106
Connection:
107107
- keep-alive
108108
User-Agent:
109-
- azsdk-python-communication-phonenumbers/1.0.2 Python/3.9.9 (Windows-10-10.0.22000-SP0)
109+
- azsdk-python-communication-phonenumbers/1.1.0b3 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)
110110
x-ms-date:
111-
- Wed, 12 Jan 2022 16:25:23 GMT
111+
- Wed, 12 Oct 2022 01:02:06 GMT
112112
x-ms-return-client-request-id:
113113
- 'true'
114114
method: GET
115-
uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/e1784c92-5251-4e28-af6c-8a7566d6cd33?api-version=2022-01-11-preview2
115+
uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/2553f1fa-fdf2-40d9-b3aa-d867515b04b7?api-version=2022-01-11-preview2
116116
response:
117117
body:
118-
string: '{"searchId": "e1784c92-5251-4e28-af6c-8a7566d6cd33", "phoneNumbers":
118+
string: '{"searchId": "2553f1fa-fdf2-40d9-b3aa-d867515b04b7", "phoneNumbers":
119119
["sanitized"], "phoneNumberType": "tollFree", "assignmentType": "application",
120120
"capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost":
121121
{"amount": 2.0, "currencyCode": "USD", "billingFrequency": "monthly"}, "searchExpiresBy":
122-
"2022-01-12T16:40:52.5420073+00:00"}'
122+
"2022-10-12T01:17:39.3633663+00:00"}'
123123
headers:
124124
api-supported-versions:
125-
- 2021-03-07, 2022-01-11-preview2
125+
- 2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01
126126
content-type:
127127
- application/json; charset=utf-8
128128
date:
129-
- Wed, 12 Jan 2022 16:25:20 GMT
129+
- Wed, 12 Oct 2022 01:02:08 GMT
130130
ms-cv:
131-
- pNLF2RdqV0ybtZdMisqs5g.0
132-
request-context:
133-
- appId=
131+
- IODqCCYl9Uuzj/VUceDsQw.0
132+
strict-transport-security:
133+
- max-age=2592000
134134
transfer-encoding:
135135
- chunked
136136
x-cache:
137137
- CONFIG_NOCACHE
138138
x-processing-time:
139-
- 1946ms
139+
- 1835ms
140140
status:
141141
code: 200
142142
message: OK

0 commit comments

Comments
 (0)