aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'unittest')
-rw-r--r--unittest/conftest.py2
-rw-r--r--unittest/test_pro.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/unittest/conftest.py b/unittest/conftest.py
index 9af67ac..35cc714 100644
--- a/unittest/conftest.py
+++ b/unittest/conftest.py
@@ -86,7 +86,7 @@ def C(request=None):
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 in [7,8] else 'S'
+ model = 'P' if firmware_version < 20 else 'S'
device_type = (model, firmware_version)
print('Connected device: {} {}'.format(model, firmware_version))
diff --git a/unittest/test_pro.py b/unittest/test_pro.py
index 5ce1e24..fb936f8 100644
--- a/unittest/test_pro.py
+++ b/unittest/test_pro.py
@@ -579,6 +579,8 @@ def test_get_code_user_authorize(C):
@pytest.mark.otp
def test_authorize_issue_admin(C):
+ skip_if_device_version_lower_than({'S': 43, 'P': 9})
+
assert C.NK_lock_device() == DeviceErrorCode.STATUS_OK
assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
@@ -592,6 +594,8 @@ def test_authorize_issue_admin(C):
@pytest.mark.otp
def test_authorize_issue_user(C):
+ skip_if_device_version_lower_than({'S': 43, 'P': 9}) # issue fixed in Pro v0.9, Storage version chosen arbitrary
+
assert C.NK_lock_device() == DeviceErrorCode.STATUS_OK
assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK