summaryrefslogtreecommitdiff
path: root/unittest/test_bindings.py
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-07-27 10:32:30 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-01 13:54:57 +0200
commit8c5b24092faf90672523e60e6eee12a83539ce11 (patch)
tree804244fd1cacc670b8fc5e58264a24d27e269084 /unittest/test_bindings.py
parentae8f2596895ba27539409b2399d985b2c613e2d7 (diff)
downloadlibnitrokey-8c5b24092faf90672523e60e6eee12a83539ce11.tar.gz
libnitrokey-8c5b24092faf90672523e60e6eee12a83539ce11.tar.bz2
Handle write config command
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest/test_bindings.py')
-rw-r--r--unittest/test_bindings.py8
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))