aboutsummaryrefslogtreecommitdiff
path: root/unittest/test_bindings.py
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-07-26 21:09:16 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-01 13:54:57 +0200
commit7f2bea1869529fb3fa53d809260e2713b43a1fd8 (patch)
tree9ca77a4f70fc7a27304c56399169e137157aeebc /unittest/test_bindings.py
parentf6bd34b262b66fde862aa3d95c339f5c587156eb (diff)
downloadlibnitrokey-7f2bea1869529fb3fa53d809260e2713b43a1fd8.tar.gz
libnitrokey-7f2bea1869529fb3fa53d809260e2713b43a1fd8.tar.bz2
Erase password safe slot
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, 8 insertions, 0 deletions
diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py
index 4ac3844..2d56865 100644
--- a/unittest/test_bindings.py
+++ b/unittest/test_bindings.py
@@ -11,6 +11,7 @@ RFC_SECRET = '12345678901234567890'
class DefaultPasswords(Enum):
ADMIN = '12345678'
USER = '123456'
+ ADMIN_TEMP = '123123123'
class DeviceErrorCode(Enum):
@@ -85,6 +86,13 @@ def test_get_password_safe_slot_login_password(C):
assert slot_password == 'pass1'
+def test_erase_password_safe_slot(C):
+ assert C.NK_enable_password_safe(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK
+ assert C.NK_erase_password_safe_slot(0) == DeviceErrorCode.STATUS_OK
+ assert gs(C.NK_get_password_safe_slot_name(0, DefaultPasswords.ADMIN_TEMP)) == ''
+ assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_OK # TODO should be DeviceErrorCode.NOT_PROGRAMMED ?
+
+
def test_password_safe_slot_status(C):
C.NK_set_debug(True)
assert C.NK_get_password_safe_slot_status() == DeviceErrorCode.STATUS_OK