From 7f2bea1869529fb3fa53d809260e2713b43a1fd8 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 26 Jul 2016 21:09:16 +0200 Subject: Erase password safe slot Signed-off-by: Szczepan Zalega --- unittest/test_bindings.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'unittest') 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 -- cgit v1.2.3