From 103f71bb4e06132e70eb26fc2f1c5ca560068107 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 31 Oct 2016 20:47:23 +0100 Subject: Tests reorganization (Python) Signed-off-by: Szczepan Zalega --- unittest/constants.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 unittest/constants.py (limited to 'unittest/constants.py') diff --git a/unittest/constants.py b/unittest/constants.py new file mode 100644 index 0000000..e3caae3 --- /dev/null +++ b/unittest/constants.py @@ -0,0 +1,30 @@ +from enum import Enum +from misc import to_hex + +RFC_SECRET_HR = '12345678901234567890' +RFC_SECRET = to_hex(RFC_SECRET_HR) # '12345678901234567890' + + +# print( repr((RFC_SECRET, RFC_SECRET_, len(RFC_SECRET))) ) + +class DefaultPasswords(Enum): + ADMIN = '12345678' + USER = '123456' + ADMIN_TEMP = '123123123' + USER_TEMP = '234234234' + + +class DeviceErrorCode(Enum): + STATUS_OK = 0 + NOT_PROGRAMMED = 3 + WRONG_PASSWORD = 4 + STATUS_NOT_AUTHORIZED = 5 + STATUS_AES_DEC_FAILED = 0xa + + +class LibraryErrors(Enum): + TOO_LONG_STRING = 200 + INVALID_SLOT = 201 + INVALID_HEX_STRING = 202 + TARGET_BUFFER_SIZE_SMALLER_THAN_SOURCE = 203 + -- cgit v1.2.1 From 7d943d3e8717ba47af4b53787cc4c29ad6ee2f90 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Wed, 2 Nov 2016 21:52:40 +0100 Subject: Python bindings and tests for most of Storage functionality Signed-off-by: Szczepan Zalega --- unittest/constants.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'unittest/constants.py') diff --git a/unittest/constants.py b/unittest/constants.py index e3caae3..258619e 100644 --- a/unittest/constants.py +++ b/unittest/constants.py @@ -12,6 +12,8 @@ class DefaultPasswords(Enum): USER = '123456' ADMIN_TEMP = '123123123' USER_TEMP = '234234234' + UPDATE = '12345678' + UPDATE_TEMP = '123update123' class DeviceErrorCode(Enum): -- cgit v1.2.1 From fe36daa38ab1995c8c7fc6470d06b8595efd2385 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 3 Nov 2016 13:51:59 +0100 Subject: Tests: remake fill SD card test. Get progress bar value when busy. Signed-off-by: Szczepan Zalega --- unittest/constants.py | 1 + 1 file changed, 1 insertion(+) (limited to 'unittest/constants.py') diff --git a/unittest/constants.py b/unittest/constants.py index 258619e..78a219b 100644 --- a/unittest/constants.py +++ b/unittest/constants.py @@ -18,6 +18,7 @@ class DefaultPasswords(Enum): class DeviceErrorCode(Enum): STATUS_OK = 0 + BUSY = 1 # busy or busy progressbar in place of wrong_CRC status NOT_PROGRAMMED = 3 WRONG_PASSWORD = 4 STATUS_NOT_AUTHORIZED = 5 -- cgit v1.2.1