aboutsummaryrefslogtreecommitdiff
path: root/unittest/test_pro_bootloader.py
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2020-02-25 14:10:30 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2020-02-26 12:26:39 +0100
commit55f9b7293c22bbedd5a972fa8f1946dfd57d9c7a (patch)
tree9eb28a9c2dd53f29280972d1fe2499e3ae8e5537 /unittest/test_pro_bootloader.py
parentb0550556c02625e59c11212421c4b81d9cddc961 (diff)
downloadlibnitrokey-55f9b7293c22bbedd5a972fa8f1946dfd57d9c7a.tar.gz
libnitrokey-55f9b7293c22bbedd5a972fa8f1946dfd57d9c7a.tar.bz2
Data retention test. Refactoring. Helper functions.
Diffstat (limited to 'unittest/test_pro_bootloader.py')
-rw-r--r--unittest/test_pro_bootloader.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/unittest/test_pro_bootloader.py b/unittest/test_pro_bootloader.py
index 4a6b272..b33a9d7 100644
--- a/unittest/test_pro_bootloader.py
+++ b/unittest/test_pro_bootloader.py
@@ -1,7 +1,8 @@
import pytest
-from conftest import skip_if_device_version_lower_than
+from conftest import skip_if_device_version_lower_than, library_device_reconnect
from constants import DefaultPasswords, DeviceErrorCode, LibraryErrors
+from helpers import helper_populate_device, helper_check_device_for_data
@pytest.mark.firmware
@@ -58,16 +59,12 @@ def test_bootloader_password_change_pro_too_long(C):
@pytest.mark.skip_by_default
@pytest.mark.firmware
-def test_bootloader_data_rention_test(C):
+def test_bootloader_data_rention(C):
skip_if_device_version_lower_than({'P': 11})
- def populate_device():
- return False
-
- def check_data_on_device():
- return False
-
- assert populate_device()
+ assert helper_populate_device(C)
assert C.NK_enable_firmware_update_pro(DefaultPasswords.UPDATE) == DeviceErrorCode.STATUS_DISCONNECTED
input('Please press ENTER after uploading new firmware to the device')
- assert check_data_on_device()
+ C = library_device_reconnect(C)
+ assert helper_check_device_for_data(C)
+