summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Bryant <corey.bryant@canonical.com>2017-08-16 11:00:21 -0400
committerCorey Bryant <corey.bryant@canonical.com>2017-08-17 08:30:43 -0400
commit395a3a8075ca2c6c8fe0163e2c79451b4c99d6e0 (patch)
tree682b4357dd87e400ac7a7995d7c57e27c87a0080
parent06f1b6f3d7a28011ebae31b3bcf73c82e741f7a9 (diff)
downloadoslo-rootwrap-395a3a8075ca2c6c8fe0163e2c79451b4c99d6e0.tar.gz
Fix test_daemon_no_cleanup_for_uninitialized_server
When mocking daemon_start(), define a string return value for tempfile.mkdtemp(), ensuring temp_dir is a string when passed to os.path.join(temp_dir, "rootwrap.sock"). Change-Id: I502c9cc53f40cbea89243a2321d1bc63f05e7c7b Closes-Bug: 1709505
-rw-r--r--oslo_rootwrap/tests/test_rootwrap.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/oslo_rootwrap/tests/test_rootwrap.py b/oslo_rootwrap/tests/test_rootwrap.py
index 13c7282..658fcb0 100644
--- a/oslo_rootwrap/tests/test_rootwrap.py
+++ b/oslo_rootwrap/tests/test_rootwrap.py
@@ -653,6 +653,7 @@ class DaemonCleanupTestCase(testtools.TestCase):
@mock.patch('tempfile.mkdtemp')
@mock.patch('multiprocessing.managers.BaseManager.get_server',
side_effect=DaemonCleanupException)
- def test_daemon_no_cleanup_for_uninitialized_server(self, gs, *args):
+ def test_daemon_no_cleanup_for_uninitialized_server(self, gs, mkd, *args):
+ mkd.return_value = '/tmp/123'
self.assertRaises(DaemonCleanupException, daemon.daemon_start,
config=None, filters=None)