aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2019-01-13 12:05:55 +0100
committerRobin Krahl <me@robin-krahl.de>2019-01-13 13:27:45 +0100
commitcf32902131d4f7bd68622ca9d243fdff5a5ed519 (patch)
tree96d7c4f49ceb396ed58d1123799bfeffe752a11b /unittest
parent5d94dece0392ce0d5486097abf8918b6922f85d2 (diff)
downloadlibnitrokey-cf32902131d4f7bd68622ca9d243fdff5a5ed519.tar.gz
libnitrokey-cf32902131d4f7bd68622ca9d243fdff5a5ed519.tar.bz2
Add simple test for NK_list_devices
Unfortunately, I cannot test more as the current ffi implementation does not allow me to import struct definitions. Without the definition for the NK_device_info struct, I cannot inspect the result of the NK_list_devices function.
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_multiple.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/unittest/test_multiple.py b/unittest/test_multiple.py
index 3f1d2d5..902234f 100644
--- a/unittest/test_multiple.py
+++ b/unittest/test_multiple.py
@@ -29,13 +29,21 @@ from tqdm import tqdm
from conftest import skip_if_device_version_lower_than
from constants import DefaultPasswords, DeviceErrorCode, bb
-from misc import gs, wait
+from misc import gs, wait, ffi
pprint = pprint.PrettyPrinter(indent=4).pprint
@pytest.mark.other
@pytest.mark.info
+def test_list_devices(C):
+ infos = C.NK_list_devices()
+ assert infos != ffi.NULL
+ C.NK_free_device_info(infos)
+
+
+@pytest.mark.other
+@pytest.mark.info
def test_get_status_storage_multiple(C):
ids = gs(C.NK_list_devices_by_cpuID())
print(ids)