summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_pro.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/unittest/test_pro.py b/unittest/test_pro.py
index afa9505..6ab7c1d 100644
--- a/unittest/test_pro.py
+++ b/unittest/test_pro.py
@@ -674,11 +674,23 @@ def test_factory_reset(C):
@pytest.mark.status
-def test_get_status(C):
- status = C.NK_status()
+def test_get_status_as_string(C):
+ status = C.NK_get_status_as_string()
s = gs(status)
assert len(s) > 0
+
+@pytest.mark.status
+def test_get_status(C):
+ status_st = ffi.new('struct NK_status *')
+ if not status_st:
+ raise Exception("Could not allocate status")
+ err = C.NK_get_status(status_st)
+ assert err == 0
+ assert status_st.firmware_version_major == 0
+ assert status_st.firmware_version_minor != 0
+
+
@pytest.mark.status
def test_get_serial_number(C):
sn = C.NK_device_serial_number()
@@ -926,4 +938,4 @@ def test_TOTP_codes_from_nitrokeyapp(secret, C):
def test_get_device_model(C):
assert C.NK_get_device_model() != 0
- # assert C.NK_get_device_model() != C.NK_DISCONNECTED \ No newline at end of file
+ # assert C.NK_get_device_model() != C.NK_DISCONNECTED