Mock the HTTP action in the with_items tests

At the moment it attempts to access http://www.example.com. This causes
a DNS lookup which will fail in some build environments.

Change-Id: Ia89db5382eacacead8e2f937ebee5af4b68ca218
This commit is contained in:
Dougal Matthews 2016-11-24 13:56:33 +00:00
parent 196ee5a7af
commit 2f89396d95

@ -13,10 +13,12 @@
# limitations under the License.
import copy
import mock
from oslo_config import cfg
import testtools
from mistral.actions import base as action_base
from mistral.actions import std_actions
from mistral.db.v2 import api as db_api
from mistral import exceptions as exc
from mistral.services import workbooks as wb_service
@ -1255,7 +1257,9 @@ class WithItemsEngineTest(base.EngineTestCase):
self.assertListEqual(sorted(result), sorted(names))
def test_with_items_and_adhoc_action(self):
@mock.patch.object(std_actions.HTTPAction, 'run')
def test_with_items_and_adhoc_action(self, mock_http_action):
wb_text = """---
version: "2.0"
@ -1314,3 +1318,5 @@ class WithItemsEngineTest(base.EngineTestCase):
self.assertEqual(2, len(task_execs))
self.assertEqual(states.SUCCESS, task1_ex.state)
self.assertEqual(states.SUCCESS, task2_ex.state)
self.assertEqual(1, mock_http_action.call_count)