Use tempfile.gettempdir() since that depends on current user and distro setup

This commit is contained in:
Pedro Algarvio 2017-02-15 18:59:13 +00:00
parent 33d8832e40
commit 9503045b05
No known key found for this signature in database
GPG Key ID: BB36BF6584A298FF

View File

@ -7,6 +7,7 @@
from __future__ import absolute_import from __future__ import absolute_import
import os.path import os.path
import glob import glob
import tempfile
# Import Salt Testing Libs # Import Salt Testing Libs
from salttesting import TestCase, skipIf from salttesting import TestCase, skipIf
@ -89,7 +90,7 @@ class QemuNbdTestCase(TestCase):
'mount.mount': mock, 'mount.mount': mock,
'cmd.retcode': MagicMock(side_effect=[1, 0])}): 'cmd.retcode': MagicMock(side_effect=[1, 0])}):
self.assertDictEqual(qemu_nbd.init('/srv/image.qcow2'), self.assertDictEqual(qemu_nbd.init('/srv/image.qcow2'),
{'/tmp/nbd/nbd0/nbd0': '/dev/nbd0'}) {'{0}/nbd/nbd0/nbd0'.format(tempfile.gettempdir()): '/dev/nbd0'})
# 'clear' function tests: 1 # 'clear' function tests: 1