Skip to content

Commit

Permalink
Bug fix in test case: A former error is no error anymore, but the tes…
Browse files Browse the repository at this point in the history
…tcase was not modiefied.
  • Loading branch information
lankes-fzj committed May 19, 2020
1 parent 97f036e commit 5f224c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/scanner/test_win32_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def __init__(self, class_name, pnp_class, vendor_id, product_id, revision_id, in
self.device.vendor_id = vendor_id
self.device.product_id = product_id
self.device.revision_id = revision_id
if "&" not in instance_id:

instance_id = instance_id.split("&")[0]
if len(instance_id) > 1:
self.device.serial = instance_id

class MockWMIConnectServer:
Expand All @@ -87,9 +89,13 @@ def setUp(self) -> None:
self.invalid_devices.append(tmp_dev)
tmp_dev = self.MockWin32Entity("Win32_PnPEntity", "USB", 0, 0, 0, "INVALID5")
tmp_dev.DeviceID = "USB" # Device id too short
tmp_dev.CompatibleID = []
tmp_dev.HardwareID = []
self.invalid_devices.append(tmp_dev)
tmp_dev = self.MockWin32Entity("Win32_PnPEntity", "USB", 0, 0, 0, "INVALID5")
tmp_dev.DeviceID = "USB\\VID_0000&PID_0000_0000" # Invalid device id format
tmp_dev.CompatibleID = []
tmp_dev.HardwareID = []
self.invalid_devices.append(tmp_dev)
tmp_dev = self.MockWin32Entity("Win32_PnPEntity", "USB", 0, 0, 0, "INVALID6")
tmp_dev.CompatibleID = ["USBXYZ\\abcdef1234"] # Invalid PNP class in device id
Expand Down

0 comments on commit 5f224c7

Please sign in to comment.