From 6ab42afc6924a329d17ee9a2e3dcf01aca63a02e Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 9 Aug 2016 11:50:25 +0200 Subject: Test for too long PIN Signed-off-by: Szczepan Zalega --- unittest/test_bindings.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3