'Test wait_for_task_completion completed. Three tries.'

@patch('time.sleep')
def test_wait_for_task_completion_good_three_tries(self, mock_time):

    module = Mock()
    try_one_two = dict(workOrderUserDefinedStatus='Pending')
    try_three = dict(workOrderUserDefinedStatus='Completed')
    module.client.api.get_task_by_id.side_effect = [try_one_two, try_one_two, try_three]
    result = cv_server_provision.wait_for_task_completion(module, '7')
    self.assertTrue(result)
    self.assertEqual(module.client.api.get_task_by_id.call_count, 3)
    module.fail_json.assert_not_called()
    self.assertEqual(mock_time.call_count, 2)
