Fix unit tests for python3.6

Make sure we are passing a string when we are running
the test_script.runner_downloadable otherwise it will fail
when using python3.6 complaining about the following:

TypeError: expected str, bytes or os.PathLike object, not MagicMock

Change-Id: Id2e4f3d6389e1855051f791d95103e7c5d449f49
Signed-off-by: Chuck Short <chucks@redhat.com>
This commit is contained in:
Chuck Short 2018-08-23 09:58:43 -04:00
parent d0875aece5
commit 407676319d
1 changed files with 4 additions and 1 deletions

View File

@ -29,11 +29,14 @@ class TestScriptRunner(base.MuranoAgentTestCase):
super(TestScriptRunner, self).setUp()
CONF.set_override('storage', 'ss')
@mock.patch('os.path.join')
@mock.patch("muranoagent.files_manager.FilesManager")
@mock.patch("muranoagent.executors.Executors")
def test_script_runner_downloable(self, mock_file_manager, mock_executors):
def test_script_runner_downloable(self, mock_file_manager, mock_executors,
mock_os):
mock_file_manager.put_file.return_value = None
mock_executors.create_executor.return_value = None
mock_os.return_value = '/tmp/1234'
template = self.get_template_downloable_git()
scripts = script_runner\
.ScriptRunner('deploy',