Skip to content

Commit 8080f7f

Browse files
adeshmukh-kssk-keeper
authored andcommitted
Fix unit test
1 parent 88a0d8b commit 8080f7f

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

keepersdk-package/src/keepersdk/authentication/device_management.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def _device_list_index(
406406

407407
def _find_matching_devices(
408408
devices: List[DeviceManagement_pb2.Device], identifier: str
409-
) -> Optional[Tuple[bytes, DeviceManagement_pb2.Device]]:
409+
) -> List[DeviceManagement_pb2.Device]:
410410
"""
411411
Resolve a device identifier to its token and device record.
412412
@@ -472,12 +472,10 @@ def _resolve_devices(
472472
seen_tokens: set[bytes] = set()
473473
for identifier in identifiers:
474474
_validate_identifier(identifier)
475-
match = _resolve_single_device(devices, identifier)
476-
if not match:
477-
raise ValueError(
478-
f'No matching device found for "{identifier}" (or ambiguous device name)'
479-
)
480-
token, device = match
475+
device = _resolve_single_device(devices, identifier)
476+
if not device:
477+
raise ValueError('No matching devices found')
478+
token = device.encryptedDeviceToken
481479
if token in seen_tokens:
482480
raise ValueError(
483481
f'Duplicate device specified: "{identifier}" resolves to a device '

0 commit comments

Comments
 (0)