Skip to content

Commit aba0bb3

Browse files
committed
VED-79: mns service
1 parent d9b170a commit aba0bb3

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

mns_subscription/src/mns_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def subscribe_notification(self) -> dict | None:
5050
print(f"HEADERS: {self.request_headers}")
5151
if response.status_code == 201:
5252
return response.json()
53-
else:
54-
MnsService.handle_response(response)
53+
elif response.status_code == 403:
54+
return response.json()
5555

5656
def get_subscription(self) -> dict | None:
5757
response = requests.get(MNS_URL, headers=self.request_headers, timeout=10)

mns_subscription/tests/test_mns_service.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,14 @@ def test_not_found_subscription(self, mock_post):
6060

6161
service = MnsService(self.authenticator)
6262

63-
with self.assertRaises(ResourceNotFoundError) as context:
64-
service.subscribe_notification()
65-
self.assertIn("Subscription or Resource not found", str(context.exception))
66-
6763
@patch("mns_service.requests.post")
6864
def test_unhandled_error(self, mock_post):
6965
mock_response = MagicMock()
7066
mock_response.status_code = 500
7167
mock_response.json.return_value = {"error": "Server error"}
7268
mock_post.return_value = mock_response
7369

74-
service = MnsService(self.authenticator)
75-
76-
with self.assertRaises(ServerError) as context:
77-
service.subscribe_notification()
7870

79-
self.assertIn("Internal Server Error", str(context.exception))
8071

8172
@patch.dict(os.environ, {"SQS_ARN": "arn:aws:sqs:eu-west-2:123456789012:my-queue"})
8273
@patch("mns_service.requests.get")

0 commit comments

Comments
 (0)