From 38f13b60708bc29d98fe0cb14e5126dc62687e9d Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Mon, 8 Oct 2018 14:20:33 +0200 Subject: [PATCH] Fix unit test run on OS X It turns out that `os.uname` on OS X indirectly resorts to the `exec` call which is intentionally mocked to fail. This patch adds another mock so that the tests pass again enabling Mac folks to engage in ironic testing! \o/ Change-Id: Ic48aed13d9ce262cb0d06ccc1d7c79f2fd2a365a --- ironic/tests/unit/api/controllers/v1/test_types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ironic/tests/unit/api/controllers/v1/test_types.py b/ironic/tests/unit/api/controllers/v1/test_types.py index 21ceac46c2..1b5cd85c43 100644 --- a/ironic/tests/unit/api/controllers/v1/test_types.py +++ b/ironic/tests/unit/api/controllers/v1/test_types.py @@ -14,6 +14,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +import platform import mock import six @@ -114,6 +115,7 @@ class MyRoot(wsme.WSRoot): class TestJsonPatchType(base.TestCase): + @mock.patch.object(platform, '_syscmd_uname', lambda *x: '') def setUp(self): super(TestJsonPatchType, self).setUp() self.app = webtest.TestApp(MyRoot(['restjson']).wsgiapp())