From 0703517f8532528ef20d8512018fcbfea58e5d93 Mon Sep 17 00:00:00 2001 From: HgO Date: Sat, 27 Aug 2022 14:14:38 +0200 Subject: [PATCH] fix tests for device_id --- tests/test_config.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 286707b..4de15a9 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -54,7 +54,7 @@ class ConfigTestCase(unittest.TestCase): self.assertEqual("@fakes_user:matrix.example.com", config.user_id) self.assertEqual("password", config.user_password) self.assertIsNone(config.user_token) - self.assertEqual("ABCDEFGHIJ", config.device_id) + self.assertIsNone(config.device_id) self.assertEqual("matrix-alertbot", config.device_name) self.assertEqual("https://matrix.example.com", config.homeserver_url) self.assertEqual(["!abcdefgh:matrix.example.com"], config.allowed_rooms) @@ -170,22 +170,6 @@ class ConfigTestCase(unittest.TestCase): with self.assertRaises(RequiredConfigKeyError): config._parse_config_values() - @patch("os.path.isdir") - @patch("os.path.exists") - @patch("os.mkdir") - def test_parse_config_with_missing_matrix_device_id( - self, fake_mkdir: Mock, fake_path_exists: Mock, fake_path_isdir: Mock - ) -> None: - fake_path_isdir.return_value = False - fake_path_exists.return_value = False - - config_path = os.path.join(CONFIG_RESOURCES_DIR, "config.minimal.yml") - config = DummyConfig(config_path) - del config.config_dict["matrix"]["device_id"] - - with self.assertRaises(RequiredConfigKeyError): - config._parse_config_values() - @patch("os.path.isdir") @patch("os.path.exists") @patch("os.mkdir")