Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

Commit

Permalink
fix(openapi): Fix openapi validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
prince737 committed Feb 25, 2021
1 parent d4843bb commit d740e53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ibm_cloud_security_advisor/notifications_api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def create_notification_channel(self, account_id: str, name: str, type: str, end
'description': description,
'severity': severity,
'enabled': enabled,
'alertSource': alert_source
'alert_source': alert_source
}

url = '/v1/{0}/notifications/channels'.format(*self._encode_path_vars(account_id))
Expand Down Expand Up @@ -309,7 +309,7 @@ def update_notification_channel(self, account_id: str, channel_id: str, name: st
'description': description,
'severity': severity,
'enabled': enabled,
'alertSource': alert_source
'alert_source': alert_source
}

url = '/v1/{0}/notifications/channels/{1}'.format(*self._encode_path_vars(account_id, channel_id))
Expand Down
14 changes: 7 additions & 7 deletions test/integration/notifications_api_v1/test_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def test_list_all_channels(self):
resp = TestNotification.ibm_security_advisor_notifications_api_sdk.list_all_channels(
account_id=TestNotification.account_id
)
assert resp.result['channels'][0]['name'] == TestNotification.notification_data[0]['name']
assert resp.status_code == 200

def test_create_notification_channel(self):
print("test_create_notification_channel...")
assert TestNotification.create_notification_channel_resp.result['statusCode'] == 200
assert TestNotification.create_notification_channel_resp.result['status_code'] == 200

def test_delete_notification_channels(self):
print("test_delete_notification_channels...")
Expand All @@ -94,15 +94,15 @@ def test_delete_notification_channels(self):
account_id=TestNotification.account_id,
**TestNotification.notification_data[1]
)
assert resp1.result['statusCode'] == 200
assert resp1.result['status_code'] == 200

TestNotification.notification_data[3]['name'] = generate_unique_name()
resp2 = TestNotification.ibm_security_advisor_notifications_api_sdk.create_notification_channel(
account_id=TestNotification.account_id,
**TestNotification.notification_data[3]
)

assert resp2.result['statusCode'] == 200
assert resp2.result['status_code'] == 200
del_resp = TestNotification.ibm_security_advisor_notifications_api_sdk.delete_notification_channels(
account_id=TestNotification.account_id,
body=[
Expand All @@ -120,7 +120,7 @@ def test_delete_notification_channel(self):
account_id=TestNotification.account_id,
**TestNotification.notification_data[1]
)
assert resp.result['statusCode'] == 200
assert resp.result['status_code'] == 200
del_resp = TestNotification.ibm_security_advisor_notifications_api_sdk.delete_notification_channel(
account_id=TestNotification.account_id,
channel_id=resp.result['channel_id'],
Expand All @@ -143,11 +143,11 @@ def test_update_notification_channel(self):
channel_id=TestNotification.create_notification_channel_resp.result['channel_id'],
**TestNotification.notification_data[2]
)
assert resp.result['statusCode'] == 200
assert resp.result['status_code'] == 200

def test_get_public_key(self):
print("test_get_public_key...")
resp = TestNotification.ibm_security_advisor_notifications_api_sdk.get_public_key(
account_id=TestNotification.account_id,
)
assert 'publicKey' in resp.result
assert 'public_key' in resp.result

0 comments on commit d740e53

Please sign in to comment.