summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2019-06-18 19:16:58 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2019-06-18 19:17:02 +0200
commit2c749223714c4d7815ca6b2d1888169a864a0fec (patch)
tree9a5273477cbd2a0bda84298a158a653199193d24
parent0275ebc610b255e3519baf866438244f288576bc (diff)
downloadlibnitrokey-2c749223714c4d7815ca6b2d1888169a864a0fec.tar.gz
libnitrokey-2c749223714c4d7815ca6b2d1888169a864a0fec.tar.bz2
Tests: correct the model getting
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--unittest/conftest.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/unittest/conftest.py b/unittest/conftest.py
index a9f46c6..7a4e2a2 100644
--- a/unittest/conftest.py
+++ b/unittest/conftest.py
@@ -130,7 +130,8 @@ def get_library(request, allow_offline=False):
assert nk_login != 0 # returns 0 if not connected or wrong model or 1 when connected
global device_type
firmware_version = C.NK_get_minor_firmware_version()
- model = 'P' if firmware_version < 20 else 'S'
+ model = C.NK_get_device_model()
+ model = 'P' if model == 1 else 'S' if model == 2 else 'U'
device_type = (model, firmware_version)
print('Connected device: {} {}'.format(model, firmware_version))