Skip to content

Commit fcae403

Browse files
committed
Fixing unittests to not configure preloading the tar as we've not mocked that bit out in this particular testcase.
Signed-off-by: Rob Dobson <[email protected]>
1 parent 69a9f53 commit fcae403

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

hwinfo/tools/inspector.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ def get_pci_devices(self):
240240

241241
class HostFromTarball(HostFromLogs):
242242

243-
def __init__(self, filename):
243+
fdata = {}
244+
245+
def __init__(self, filename, preload=True):
244246
self.tarloc = filename
245247
pre_load_files = [
246248
'lspci-nnm.out',
@@ -251,7 +253,8 @@ def __init__(self, filename):
251253
'xensource-inventory'
252254
]
253255

254-
self._preload_files(pre_load_files)
256+
if preload:
257+
self._preload_files(pre_load_files)
255258

256259
def _preload_files(self, filenames):
257260
paths = []

hwinfo/tools/tests/test_inspector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test__load_from_file(self, read_from_tarball, find_in_tarball):
5959
filepath = find_in_tarball.return_value = \
6060
'somedir/anotherdir/%s' % filename
6161

62-
host = inspector.HostFromTarball('test.tar.gz')
62+
host = inspector.HostFromTarball('test.tar.gz', preload=False)
6363
host._load_from_file(filename)
6464

6565
find_in_tarball.assert_called_once_with(tarball_name, filename)

0 commit comments

Comments
 (0)