Browse Source

Delete temporary file after media ejection

Story: 2008742
Task: 42096

Change-Id: If1a4fe6b08a3845aa2217e22d773855656087989
changes/14/782514/3
François Rigault 3 months ago
parent
commit
83fa744fbb
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      sushy_tools/emulator/resources/vmedia.py
  2. +1
    -0
      sushy_tools/tests/unit/emulator/resources/test_vmedia.py

+ 1
- 1
sushy_tools/emulator/resources/vmedia.py View File

@ -188,7 +188,7 @@ class StaticDriver(base.DriverBase):
device_info['Image'] = local_file
device_info['Inserted'] = inserted
device_info['WriteProtected'] = write_protected
device_info['_local_file_path'] = local_file_path
device_info['_local_file'] = local_file_path
self._devices.update({(identity, device): device_info})


+ 1
- 0
sushy_tools/tests/unit/emulator/resources/test_vmedia.py View File

@ -105,6 +105,7 @@ class StaticDriverTestCase(base.BaseTestCase):
self.assertEqual('fish.iso', device_info['Image'])
self.assertTrue(device_info['Inserted'])
self.assertFalse(device_info['WriteProtected'])
self.assertEqual(local_file, device_info['_local_file'])
@mock.patch.object(vmedia.StaticDriver, '_get_device', autospec=True)
@mock.patch.object(builtins, 'open', autospec=True)


Loading…
Cancel
Save