Skip to content

Commit

Permalink
[tests] Fixed broken tests due to ow-controller changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Oct 22, 2020
1 parent 4d12a84 commit fd215d4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions openwisp_monitoring/device/tests/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,16 @@ def test_is_working_changed_unable_to_connect(self, notify_send, perform_check):
dc.failure_reason = '[Errno None] Unable to connect to port 5555 on 127.0.0.1'
dc.full_clean()
dc.save()

notify_send.assert_not_called()
perform_check.assert_not_called()

@patch.object(Check, 'perform_check')
@patch.object(notify, 'send')
def test_is_working_changed_timed_out(self, notify_send, perform_check):
ckey = self._create_credentials_with_key(port=self.ssh_server.port)
dc = self._create_device_connection(credentials=ckey)
dc = self._create_device_connection(credentials=ckey, is_working=None)
self.assertIsNone(dc.is_working)
dc.is_working = True
dc.save()
notify_send.assert_not_called()
perform_check.assert_not_called()

d = self.device_model.objects.first()
Expand All @@ -149,8 +147,6 @@ def test_is_working_changed_timed_out(self, notify_send, perform_check):
dc.failure_reason = 'timed out'
dc.full_clean()
dc.save()

notify_send.assert_not_called()
perform_check.assert_not_called()

@patch.object(Check, 'perform_check')
Expand All @@ -171,5 +167,4 @@ def test_is_working_no_recovery_notification(self, notify_send, perform_check):
dc.failure_reason = ''
dc.is_working = True
dc.save()
notify_send.assert_not_called()
perform_check.assert_not_called()

0 comments on commit fd215d4

Please sign in to comment.