Fix wrong patch in unit tests

Patch must be stopped after test is done, so fixing
incorrect patch in this setUp method.

Change-Id: I5bb1dc4d82e6d644207ae777a62ddec39e5a290f
This commit is contained in:
Vitaly Gridnev 2017-06-16 17:51:02 +04:00
parent 29ccc49ec4
commit 7744bb8289
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,6 @@ import mock
from sahara.plugins import exceptions as ex
from sahara.plugins.vanilla.hadoop2 import edp_engine
from sahara.service.edp import job_utils
from sahara.tests.unit import base as sahara_base
@ -28,8 +27,9 @@ class EdpOozieEngineTest(sahara_base.SaharaTestCase):
def setUp(self):
super(EdpOozieEngineTest, self).setUp()
self.cluster = mock.Mock()
job_utils.get_plugin = mock.Mock(return_value='test_plugins')
self.engine = edp_engine.EdpOozieEngine(self.cluster)
with mock.patch('sahara.service.edp.job_utils.get_plugin',
return_value='test_plugins'):
self.engine = edp_engine.EdpOozieEngine(self.cluster)
def test_get_hdfs_user(self):
self.assertEqual(self.engine.get_hdfs_user(), 'hadoop')