aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2019-01-26 17:53:53 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2019-01-26 21:13:15 +0100
commit502b534e50737372d9e48b9c3e063b3281988b82 (patch)
tree6cc57f8230fcd60fd371831ef9357043965840fa /unittest
parent1e45aacdd9df8ca9322a8c68be488d92fa628cf8 (diff)
downloadlibnitrokey-502b534e50737372d9e48b9c3e063b3281988b82.tar.gz
libnitrokey-502b534e50737372d9e48b9c3e063b3281988b82.tar.bz2
Small correction for macOS 10.13.6
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_storage.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/unittest/test_storage.py b/unittest/test_storage.py
index b4b21ea..53ad006 100644
--- a/unittest/test_storage.py
+++ b/unittest/test_storage.py
@@ -499,13 +499,16 @@ def test_export_firmware_extended_macos(C):
device_item = None
for item in devices:
+ if '_items' in item:
+ # Fix for macOS 10.13.6, Python 3.6.2
+ item = item['_items'][0]
if 'manufacturer' in item and item['manufacturer'] == 'Nitrokey':
device_item = item
# Try to get first volume of USB device
try:
volume = device_item['Media'][0]['volumes'][0]
- except KeyError:
+ except (KeyError, TypeError):
volume = None
assert volume is not None, 'could not determine volume'