aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-07-26 17:14:33 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-01 13:54:57 +0200
commit664d33c8966f478d6f077a666a39a5b76a235ffa (patch)
tree974a2eb7ac68d07831f0bcc118888fd9e7291cba /unittest
parent32ed4100e098ae2930e6fd94800c6ce7041101c2 (diff)
downloadlibnitrokey-664d33c8966f478d6f077a666a39a5b76a235ffa.tar.gz
libnitrokey-664d33c8966f478d6f077a666a39a5b76a235ffa.tar.bz2
Handling PW safe login and password
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_bindings.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py
index f5d5cf7..6d9e490 100644
--- a/unittest/test_bindings.py
+++ b/unittest/test_bindings.py
@@ -55,7 +55,7 @@ def test_enable_password_safe(C):
def test_get_password_safe_slot_name(C):
- C.NK_set_debug(True)
+ # C.NK_set_debug(True)
assert C.NK_lock_device() == DeviceErrorCode.STATUS_OK
assert gs(C.NK_get_password_safe_slot_name(0, '123123123')) == ''
assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_NOT_AUTHORIZED
@@ -63,6 +63,17 @@ def test_get_password_safe_slot_name(C):
assert C.NK_enable_password_safe(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK
assert gs(C.NK_get_password_safe_slot_name(0, '123123123')) == '1'
assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_OK
+ # C.NK_set_debug(False)
+
+def test_get_password_safe_slot_login_password(C):
+ C.NK_set_debug(True)
+ assert C.NK_enable_password_safe(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK
+ slot_login = C.NK_get_password_safe_slot_login(0, '123123123')
+ assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_OK
+ assert gs(slot_login) == '1'
+ slot_password = gs(C.NK_get_password_safe_slot_password(0, '123123123'))
+ assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_OK
+ assert slot_password == '1'
C.NK_set_debug(False)