Skip to content

Commit 81698e1

Browse files
committed
mns subscription
1 parent 71ed38e commit 81698e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mns_subscription/src/mns_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ def subscribe_notification(self) -> dict | None:
4747
elif response.status_code == 404:
4848
return None
4949
else:
50-
msg = "Please provide the correct resource type for this endpoint"
50+
msg = f"MNS subscription failed"
5151
raise UnhandledResponseError(response=response.json(), message=msg)

mns_subscription/tests/test_mns_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def setUp(self):
1717
def test_successful_subscription(self, mock_post):
1818
# Arrange
1919
mock_response = MagicMock()
20-
mock_response.status_code = 200
20+
mock_response.status_code = 201
2121
mock_response.json.return_value = {"subscriptionId": "abc123"}
2222
mock_post.return_value = mock_response
2323

@@ -54,7 +54,7 @@ def test_unhandled_error(self, mock_post):
5454
with self.assertRaises(UnhandledResponseError) as context:
5555
service.subscribe_notification()
5656

57-
self.assertIn("MNS subscription failed with status", str(context.exception))
57+
self.assertIn("MNS subscription failed", str(context.exception))
5858

5959

6060
if __name__ == "__main__":

0 commit comments

Comments
 (0)