aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-07-28 14:48:36 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-01 13:54:58 +0200
commit8c3fe8c68b40097e9326682c2073b71201358a2d (patch)
tree41ae1e5cccb8fd762bc423eab7d5121217e0ed22
parenta5f173f56e037f4f10a18bd0d5a7e316bbbf70c6 (diff)
downloadlibnitrokey-8c3fe8c68b40097e9326682c2073b71201358a2d.tar.gz
libnitrokey-8c3fe8c68b40097e9326682c2073b71201358a2d.tar.bz2
Fixed PWS slot status test
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--unittest/test_bindings.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py
index 2fd45d9..9540888 100644
--- a/unittest/test_bindings.py
+++ b/unittest/test_bindings.py
@@ -103,14 +103,13 @@ def test_password_safe_slot_status(C):
C.NK_set_debug(True)
assert C.NK_enable_password_safe(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK
assert C.NK_erase_password_safe_slot(0) == DeviceErrorCode.STATUS_OK
+ assert C.NK_write_password_safe_slot(1, 'slotname2', 'login2', 'pass2') == DeviceErrorCode.STATUS_OK
safe_slot_status = C.NK_get_password_safe_slot_status()
assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_OK
is_slot_programmed = list(ffi.cast("uint8_t [16]", safe_slot_status)[0:16])
print ((is_slot_programmed, len(is_slot_programmed)))
- assert is_slot_programmed[
- 0] == 0 # FIXME not programmed, assuming erased in preceeding test, add writing and erasing
- assert is_slot_programmed[1] == 1 # FIXME assuming slot 1 is programmed, not writing there in this tests, same as ^
- # C.NK_set_debug(False)
+ assert is_slot_programmed[0] == 0
+ assert is_slot_programmed[1] == 1
def test_admin_PIN_change(C):