diff --git a/tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py b/tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py index b0374c424..031ec1349 100644 --- a/tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py +++ b/tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py @@ -13,6 +13,7 @@ # under the License. # +import io import mock import os @@ -39,7 +40,10 @@ class TestOvercloudImageBuild(TestPluginV1): parsed_args = self.check_parser(self.cmd, arglist, verifylist) - self.cmd.take_action(parsed_args) + redhat_release = io.StringIO(u'CentOS Fake Release') + with mock.patch('tripleoclient.v1.overcloud_image.open', + return_value=redhat_release, create=True): + self.cmd.take_action(parsed_args) self.assertEqual(2, self.cmd._ramdisk_image_create.call_count) self.assertEqual(1, self.cmd._disk_image_create.call_count)