Skip to content

Commit 3db207d

Browse files
[Communication]: Added error code assertion back into SMS test (Azure#18313)
1 parent 97978c4 commit 3db207d

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

sdk/communication/azure-communication-sms/tests/recordings/test_sms_client_e2e.test_send_sms_unauthorized_from_phone_number.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interactions:
1515
Content-Type:
1616
- application/json
1717
Date:
18-
- Tue, 13 Apr 2021 18:38:07 GMT
18+
- Mon, 26 Apr 2021 20:44:56 GMT
1919
User-Agent:
2020
- azsdk-python-communication-sms/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0)
2121
x-ms-return-client-request-id:
@@ -31,14 +31,14 @@ interactions:
3131
content-length:
3232
- '0'
3333
date:
34-
- Tue, 13 Apr 2021 18:38:07 GMT
34+
- Mon, 26 Apr 2021 20:44:56 GMT
3535
ms-cv:
36-
- K2Dj4s4VfUSSX85g/GLf7Q.0
36+
- J4SJhRMiv0iKUhAQqxUttw.0
3737
request-context:
3838
- appId=
3939
x-processing-time:
40-
- 429ms
40+
- 278ms
4141
status:
42-
code: 404
43-
message: Not Found
42+
code: 401
43+
message: Unauthorized
4444
version: 1

sdk/communication/azure-communication-sms/tests/recordings/test_sms_client_e2e_async.test_send_sms_unauthorized_from_phone_number_async.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interactions:
1111
Content-Type:
1212
- application/json
1313
Date:
14-
- Tue, 13 Apr 2021 18:38:14 GMT
14+
- Mon, 26 Apr 2021 20:45:02 GMT
1515
User-Agent:
1616
- azsdk-python-communication-sms/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0)
1717
x-ms-return-client-request-id:
@@ -24,12 +24,12 @@ interactions:
2424
headers:
2525
api-supported-versions: 2020-07-20-preview1, 2020-08-20-preview, 2021-03-07
2626
content-length: '0'
27-
date: Tue, 13 Apr 2021 18:38:15 GMT
28-
ms-cv: 5QaPxrtpUUaGdFDPDzndrw.0
27+
date: Mon, 26 Apr 2021 20:45:02 GMT
28+
ms-cv: G+jHfvCEjECPwEKrIJkC4w.0
2929
request-context: appId=
30-
x-processing-time: 326ms
30+
x-processing-time: 332ms
3131
status:
32-
code: 404
33-
message: Not Found
32+
code: 401
33+
message: Unauthorized
3434
url: https://sanitized.communication.azure.com/sms?api-version=2021-03-07
3535
version: 1

sdk/communication/azure-communication-sms/tests/test_sms_client_e2e.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def test_send_sms_unauthorized_from_phone_number(self):
133133
to=[self.phone_number],
134134
message="Hello World via SMS")
135135

136+
assert str(ex.value.status_code) == "401"
136137
assert ex.value.message is not None
137138

138139
@pytest.mark.live_test_only

sdk/communication/azure-communication-sms/tests/test_sms_client_e2e_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ async def test_send_sms_unauthorized_from_phone_number_async(self):
144144
to=[self.phone_number],
145145
message="Hello World via SMS")
146146

147+
assert str(ex.value.status_code) == "401"
147148
assert ex.value.message is not None
148149

149150
@AsyncCommunicationTestCase.await_prepared_test

0 commit comments

Comments
 (0)