aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unittest/test_bindings.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py
index 7816f41..d072bfc 100644
--- a/unittest/test_bindings.py
+++ b/unittest/test_bindings.py
@@ -187,6 +187,11 @@ def test_user_PIN_change(C):
assert C.NK_change_user_PIN(new_password, DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK
+def test_too_long_PIN(C):
+ new_password = '123123123'
+ assert C.NK_change_user_PIN('a' * 100, new_password) == DeviceErrorCode.WRONG_PASSWORD
+
+
def test_admin_retry_counts(C):
default_admin_retry_count = 3
assert C.NK_get_admin_retry_count() == default_admin_retry_count
@@ -356,6 +361,7 @@ def test_get_OTP_codes(C):
if code == 0:
assert C.NK_get_last_command_status() == DeviceErrorCode.NOT_PROGRAMMED
+
def test_get_OTP_code_from_not_programmed_slot(C):
assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
assert C.NK_erase_hotp_slot(0, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK