Skip to content

Commit

Permalink
updated tests to account for new argument being passed
Browse files Browse the repository at this point in the history
  • Loading branch information
jwcolbert committed Aug 17, 2017
1 parent 4dc4f97 commit 402bc83
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_clc_server_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,11 @@ def test_wait_for_requests_w_mock_request(self):
mock_r2 = mock.MagicMock()
mock_r2.WaitUntilComplete.return_value = True
requests = [mock_r1, mock_r2]

self.module.wait = True

under_test = ClcSnapshot(self.module)
under_test._wait_for_requests_to_complete(requests)
under_test._wait_for_requests_to_complete(requests, mock.MagicMock())
self.assertFalse(self.module.fail_json.called)

def test_wait_for_requests_w_mock_request_fail(self):
Expand All @@ -299,7 +300,7 @@ def test_wait_for_requests_w_mock_request_fail(self):
self.module.wait = True

under_test = ClcSnapshot(self.module)
under_test._wait_for_requests_to_complete(requests)
under_test._wait_for_requests_to_complete(requests, mock.MagicMock())
self.assertTrue(self.module.fail_json.called)

@patch.object(ClcSnapshot, '_get_servers_from_clc')
Expand All @@ -326,7 +327,7 @@ def test_wait_for_requests_to_complete(self,mock_get_servers):
server_ids = ['INVALID']
mock_get_servers.return_value=[mock.MagicMock()]
under_test = ClcSnapshot(self.module)
under_test._wait_for_requests_to_complete (mock.MagicMock())
under_test._wait_for_requests_to_complete (mock.MagicMock(), mock.MagicMock())
self.assertFalse(self.module.fail_json.called)

def test_wait_for_requests_no_wait(self):
Expand All @@ -336,7 +337,7 @@ def test_wait_for_requests_no_wait(self):
'wait': False
}
under_test = ClcSnapshot(self.module)
under_test._wait_for_requests_to_complete([mock_request])
under_test._wait_for_requests_to_complete([mock_request], mock.MagicMock())
self.assertFalse(self.module.fail_json.called)

def test_create_server_snapshot_exception(self):
Expand Down

0 comments on commit 402bc83

Please sign in to comment.