summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-08-05 10:01:55 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-05 10:19:25 +0200
commit0a32f4c7b08955c5b687c9d92bb43b945c6ad56e (patch)
treebe6a6a2ac382a81a82586f846404e9520f697a09
parent9eb8cb8d63fcde52e097dadf312f6f22393ad6fb (diff)
downloadlibnitrokey-0a32f4c7b08955c5b687c9d92bb43b945c6ad56e.tar.gz
libnitrokey-0a32f4c7b08955c5b687c9d92bb43b945c6ad56e.tar.bz2
Make is_AES test more strict (check behavior for wrong password)
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--unittest/test_bindings.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py
index 0290fd6..6413d59 100644
--- a/unittest/test_bindings.py
+++ b/unittest/test_bindings.py
@@ -162,8 +162,9 @@ def test_destroy_password_safe(C):
def test_is_AES_supported(C):
- aes_supported = C.NK_is_AES_supported(DefaultPasswords.USER)
- assert aes_supported == 1
+ assert C.NK_is_AES_supported('wrong password') != 1
+ assert C.NK_get_last_command_status() == DeviceErrorCode.WRONG_PASSWORD
+ assert C.NK_is_AES_supported(DefaultPasswords.USER) == 1
assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_OK