diff --git a/tests/test_config.py b/tests/test_config.py index 5d3282d..a023cf7 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -25,7 +25,7 @@ def test_default_config(self): self.assertEqual(config, {}) @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') def test_backwards_compat(self, mock_yamlload): mock_yamlload.return_value = {'backend': 'foobar'} config = load_config(DEFAULT_CONFIG) @@ -36,7 +36,7 @@ def test_backwards_compat(self, mock_yamlload): environ.get('CI') and py_ in [(3, 3), (3, 4)], 'Python 3.3 and 3.4 fail in TravisCI, but 3.4 works on Ubuntu 14.04') @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') def test_parse_error(self, mock_yamlload): mock_yamlload.side_effect = ValueError self.assertRaises(SystemExit, load_config) diff --git a/tests/test_integration.py b/tests/test_integration.py index 293d00e..9c27fd1 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -12,7 +12,7 @@ class TestIntegration(TestCase): @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') @patch('ntfy.backends.pushover.requests.post') def test_pushover(self, mock_post, mock_yamlload): mock_yamlload.return_value = { @@ -22,7 +22,7 @@ def test_pushover(self, mock_post, mock_yamlload): self.assertEqual(0, ntfy_main(['send', 'foobar'])) @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') @patch('ntfy.backends.prowl.requests.post') def test_prowl(self, mock_post, mock_yamlload): mock_yamlload.return_value = { @@ -32,7 +32,7 @@ def test_prowl(self, mock_post, mock_yamlload): ntfy_main(['send', 'foobar']) @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') @patch('ntfy.backends.pushbullet.requests.post') def test_pushbullet(self, mock_post, mock_yamlload): mock_yamlload.return_value = { @@ -42,7 +42,7 @@ def test_pushbullet(self, mock_post, mock_yamlload): self.assertEqual(0, ntfy_main(['send', 'foobar'])) @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') @patch('ntfy.backends.simplepush.requests.post') def test_simplepush(self, mock_post, mock_yamlload): mock_yamlload.return_value = { @@ -53,7 +53,7 @@ def test_simplepush(self, mock_post, mock_yamlload): @patch(builtin_module + '.open', mock_open()) @patch('ntfy.backends.default.platform', 'linux') - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') def test_default(self, mock_yamlload): old_dbus = modules.get('dbus') modules['dbus'] = MagicMock() @@ -65,7 +65,7 @@ def test_default(self, mock_yamlload): modules['dbus'] = old_dbus @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') def test_linux(self, mock_yamlload): old_dbus = modules.get('dbus') modules['dbus'] = MagicMock() @@ -77,7 +77,7 @@ def test_linux(self, mock_yamlload): modules['dbus'] = old_dbus @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') def test_darwin(self, mock_yamlload): old_foundation = modules.get('Foundation') old_objc = modules.get('objc') @@ -97,7 +97,7 @@ def test_darwin(self, mock_yamlload): modules['AppKit'] = old_appkit @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') def test_win32(self, mock_yamlload): old_win32api = modules.get('win32api') old_win32gui = modules.get('win32gui') @@ -117,7 +117,7 @@ def test_win32(self, mock_yamlload): modules['win32con'] = old_win32con @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') @patch('ntfy.backends.xmpp.NtfySendMsgBot') def test_xmpp(self, mock_bot, mock_yamlload): mock_yamlload.return_value = {'backends': ['xmpp'], @@ -127,7 +127,7 @@ def test_xmpp(self, mock_bot, mock_yamlload): self.assertEqual(0, ntfy_main(['send', 'foobar'])) @patch(builtin_module + '.open', mock_open()) - @patch('ntfy.config.yaml.load') + @patch('ntfy.config.yaml.safe_load') def test_instapush(self, mock_yamlload): def nt(event_name=None,trackers=None): return { 'status': 200 }