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
This commit is contained in:
Ilya Etingof 2018-10-08 14:20:33 +02:00
parent 65fd114267
commit 38f13b6070
1 changed files with 2 additions and 0 deletions

View File

@ -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())