diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-07-27 10:32:30 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-01 13:54:57 +0200 |
commit | 8c5b24092faf90672523e60e6eee12a83539ce11 (patch) | |
tree | 804244fd1cacc670b8fc5e58264a24d27e269084 /unittest | |
parent | ae8f2596895ba27539409b2399d985b2c613e2d7 (diff) | |
download | libnitrokey-8c5b24092faf90672523e60e6eee12a83539ce11.tar.gz libnitrokey-8c5b24092faf90672523e60e6eee12a83539ce11.tar.bz2 |
Handle write config command
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/test_bindings.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py index f3c3ee7..e94a6d6 100644 --- a/unittest/test_bindings.py +++ b/unittest/test_bindings.py @@ -37,10 +37,11 @@ def C(request): ffi.cdef(declaration) C = ffi.dlopen("../build/libnitrokey.so") + C.NK_set_debug(False) C.NK_login(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) assert C.NK_user_authenticate(DefaultPasswords.USER, DefaultPasswords.USER_TEMP) == DeviceErrorCode.STATUS_OK - # C.NK_set_debug(True) + # C.NK_status() def fin(): print ('\nFinishing connection to device') @@ -164,10 +165,11 @@ def test_TOTP_RFC(C): def test_get_slot_names(C): C.NK_set_debug(True) + assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK assert C.NK_erase_totp_slot(0, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK # erasing slot invalidates temporary password, so requesting authentication - # 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 + 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 for i in range(16): name = ffi.string(C.NK_get_totp_slot_name(i)) |