From ceedc4e1e576344326013c5f403cd98fd42115d6 Mon Sep 17 00:00:00 2001 From: Artanicus Date: Sun, 5 Feb 2023 23:20:36 +0200 Subject: [PATCH] More explicit typing and minor cleanup --- src/notifier/slack_notifier.py | 2 +- tests/chia_log/handlers/test_wallet_added_coin_handler.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/notifier/slack_notifier.py b/src/notifier/slack_notifier.py index 0c849ca..e693429 100644 --- a/src/notifier/slack_notifier.py +++ b/src/notifier/slack_notifier.py @@ -17,7 +17,7 @@ def __init__(self, title_prefix: str, config: ConfigView): logging.info("Initializing Slack notifier.") super().__init__(title_prefix, config) try: - credentials = config["credentials"].get() + credentials = config["credentials"].get(dict) self.webhook_url = credentials["webhook_url"] except KeyError as key: logging.error(f"Invalid config.yaml. Missing key: {key}") diff --git a/tests/chia_log/handlers/test_wallet_added_coin_handler.py b/tests/chia_log/handlers/test_wallet_added_coin_handler.py index 8f2dc63..d714ede 100644 --- a/tests/chia_log/handlers/test_wallet_added_coin_handler.py +++ b/tests/chia_log/handlers/test_wallet_added_coin_handler.py @@ -22,7 +22,6 @@ def setUp(self) -> None: self.example_logs_path = Path(__file__).resolve().parents[1] / "logs/wallet_added_coin" def tearDown(self) -> None: - # self.handler_config.clear() self.config.clear() def testConfig(self):