Fix unit tests on non-Red Hat distros
We were looking for /etc/redhat-release, which won't work on anything not Red Hat-derived. Such as the gate. :-) Change-Id: I07249a196764aa599788b26417e37b87f4b1bc11
This commit is contained in:
parent
12edde8a53
commit
e4f71ada86
@ -13,6 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import io
|
||||||
import mock
|
import mock
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -39,6 +40,9 @@ class TestOvercloudImageBuild(TestPluginV1):
|
|||||||
|
|
||||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||||
|
|
||||||
|
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.cmd.take_action(parsed_args)
|
||||||
|
|
||||||
self.assertEqual(2, self.cmd._ramdisk_image_create.call_count)
|
self.assertEqual(2, self.cmd._ramdisk_image_create.call_count)
|
||||||
|
Loading…
Reference in New Issue
Block a user