Skip to content

Commit

Permalink
Fix formatting errors. Added typings to CONTENT.
Browse files Browse the repository at this point in the history
Signed-off-by: AbitraryYu <[email protected]>
  • Loading branch information
AbitraryYu committed Apr 30, 2024
1 parent 3240540 commit 891c250
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test_opensearchpy/test_server/test_plugins/test_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
from __future__ import unicode_literals

import unittest

from opensearchpy.helpers.test import OPENSEARCH_VERSION
from typing import Any, Dict

from opensearchpy.exceptions import NotFoundError
from opensearchpy.helpers.test import OPENSEARCH_VERSION

from .. import OpenSearchTestCase


class TestNotificationPlugin(OpenSearchTestCase):
CONFIG_ID = "sample-id"
CONTENT = {
CONTENT: Dict[str, Any] = {
"config_id": "sample-id",
"name": "sample-name",
"config": {
Expand Down Expand Up @@ -74,7 +74,9 @@ def test_list_all_config(self) -> None:
def test_get_config(self) -> None:
self.test_create_config()

response = self.client.plugins.notifications.get_config(config_id=self.CONFIG_ID)
response = self.client.plugins.notifications.get_config(
config_id=self.CONFIG_ID
)

self.assertNotIn("errors", response)
self.assertIn("config_list", response)
Expand All @@ -93,7 +95,9 @@ def test_update_config(self) -> None:

channel_content = self.CONTENT.copy()
channel_content["config"]["name"] = "Slack Channel"
channel_content["config"]["description"] = "This is an updated channel configuration"
channel_content["config"][
"description"
] = "This is an updated channel configuration"
channel_content["config"]["config_type"] = "slack"
channel_content["config"]["is_enabled"] = True
channel_content["config"]["slack"]["url"] = "https://hooks.slack.com/sample-url"
Expand Down

0 comments on commit 891c250

Please sign in to comment.