From 0a32f4c7b08955c5b687c9d92bb43b945c6ad56e Mon Sep 17 00:00:00 2001
From: Szczepan Zalega <szczepan@nitrokey.com>
Date: Fri, 5 Aug 2016 10:01:55 +0200
Subject: Make is_AES test more strict (check behavior for wrong password)

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
---
 unittest/test_bindings.py | 5 +++--
 1 file 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
 
 
-- 
cgit v1.2.3