Merge "Use mock for a bad HTTP call in unit tests"

This commit is contained in:
Jenkins 2016-11-17 10:22:25 +00:00 committed by Gerrit Code Review
commit ae141ff013
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@
import mock
from oslo_config import cfg
import requests
from mistral.actions import std_actions
from mistral.db.v2 import api as db_api
@ -521,6 +522,11 @@ class PoliciesTest(base.EngineTestCase):
# Need to create a better test.
# self.assertEqual(2, task_ex.in_context['wait_after'])
@mock.patch.object(
requests,
'request',
mock.MagicMock(side_effect=Exception())
)
def test_retry_policy(self):
wb_service.create_workbook_v2(RETRY_WB)