From 8d71c615f2ee84bb53d93f6114ad6a17ecf81285 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Fri, 12 Apr 2019 07:08:51 +0000 Subject: [PATCH] Improve test coverage of nova.privsep.utils. Trivial, but makes testing coverage for this file complete. Change-Id: Ie3a7ac393a558e450fba5f51b05ffae7f73a32a4 --- nova/tests/unit/privsep/test_utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nova/tests/unit/privsep/test_utils.py b/nova/tests/unit/privsep/test_utils.py index 84d0767c2963..f136572750e8 100644 --- a/nova/tests/unit/privsep/test_utils.py +++ b/nova/tests/unit/privsep/test_utils.py @@ -18,6 +18,7 @@ import os import nova.privsep.utils from nova import test +from nova.tests import fixtures class SupportDirectIOTestCase(test.NoDBTestCase): @@ -125,3 +126,14 @@ class SupportDirectIOTestCase(test.NoDBTestCase): self.mock_write.assert_not_called() self.mock_close.assert_not_called() self.mock_unlink.assert_called_once_with(self.test_path) + + +class UtilsTestCase(test.NoDBTestCase): + def setUp(self): + super(UtilsTestCase, self).setUp() + self.useFixture(fixtures.PrivsepFixture()) + + @mock.patch('os.kill') + def test_kill(self, mock_kill): + nova.privsep.utils.kill(42, -9) + mock_kill.assert_called_with(42, -9)