Skip to content

Commit

Permalink
oops. forgot to update test mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
dschep committed Dec 2, 2016
1 parent eea05d2 commit 515c589
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
20 changes: 10 additions & 10 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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')
Expand All @@ -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')
Expand All @@ -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'],
Expand All @@ -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 }
Expand Down

0 comments on commit 515c589

Please sign in to comment.