Skip to content

Commit a5c8ac6

Browse files
committed
VED-79: fix lint issues
1 parent 71e47b5 commit a5c8ac6

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

mns_subscription/src/mns_service.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,29 @@
77
SQS_ARN = "arn:aws:sqs:eu-west-2:345594581768:imms-pr-655-id-sync-queue"
88
MNS_URL = "https://int.api.service.nhs.uk/multicast-notification-service/subscriptions"
99

10+
1011
class MnsService:
1112
def __init__(self, authenticator: AppRestrictedAuth):
1213
self.authenticator = authenticator
13-
14-
15-
16-
def subscribeNotification(self) -> dict | None:
14+
15+
def subscribeNotification(self) -> dict | None:
1716
access_token = self.authenticator.get_access_token()
1817
request_headers = {
1918
'Authorization': f'Bearer {access_token}',
2019
'X-Correlation-ID': str(uuid.uuid4())
2120
}
22-
21+
2322
subscription_payload = {
24-
"resourceType": "Subscription",
25-
"status": "requested",
26-
"reason": "Subscribe SQS to MNS test-signal",
27-
"criteria": "eventType=mns-test-signal-1",
28-
"channel": {
29-
"type": "message",
30-
"endpoint": SQS_ARN,
31-
"payload": "application/json"
32-
}
33-
}
23+
"resourceType": "Subscription",
24+
"status": "requested",
25+
"reason": "Subscribe SQS to MNS test-signal",
26+
"criteria": "eventType=mns-test-signal-1",
27+
"channel": {
28+
"type": "message",
29+
"endpoint": SQS_ARN,
30+
"payload": "application/json"
31+
}
32+
}
3433
response = requests.post(MNS_URL, headers=request_headers, data=json.dumps(subscription_payload))
3534

3635
if response.status_code == 200:

mns_subscription/tests/test_authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from authentication import AppRestrictedAuth, Service
1010
from models.errors import UnhandledResponseError
1111

12-
"test"
12+
1313
class TestAuthenticator(unittest.TestCase):
1414
def setUp(self):
1515
self.kid = "a_kid"

mns_subscription/tests/test_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from cache import Cache
66

7-
"test"
7+
88
class TestCache(unittest.TestCase):
99
def setUp(self):
1010
self.cache = Cache(tempfile.gettempdir())

mns_subscription/tests/test_mns_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66

77

88
class TestMnsService(unittest.TestCase):
9-
109
def setUp(self):
1110
# Common mock setup
1211
self.authenticator = create_autospec(AppRestrictedAuth)
1312
self.authenticator.get_access_token.return_value = "mocked_token"
1413
self.mock_secret_manager = Mock()
1514
self.mock_cache = Mock()
16-
15+
1716
@patch("mns_service.requests.post")
1817
def test_successful_subscription(self, mock_post):
1918
# Arrange
@@ -57,5 +56,6 @@ def test_unhandled_error(self, mock_post):
5756

5857
self.assertIn("Please provide the correct resource type", str(context.exception))
5958

59+
6060
if __name__ == "__main__":
61-
unittest.main()
61+
unittest.main()

0 commit comments

Comments
 (0)