summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qeeprom.py
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-06-25 11:45:31 +0200
committerHector Fernandez <hector@iatec.biz>2020-06-25 11:45:31 +0200
commitdb3b1e45c47a1ef23c1ad67114a09cbec0976681 (patch)
tree6833ba2e59be77f9e818823068570ca3d51959cc /test-cli/test/tests/qeeprom.py
parent278b5729a44837e37fe13611518c1babc8de00df (diff)
downloadboard-db3b1e45c47a1ef23c1ad67114a09cbec0976681.zip
board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.gz
board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.bz2
Solved bugs. Adapted to DB changes.
Diffstat (limited to 'test-cli/test/tests/qeeprom.py')
-rw-r--r--test-cli/test/tests/qeeprom.py37
1 files changed, 34 insertions, 3 deletions
diff --git a/test-cli/test/tests/qeeprom.py b/test-cli/test/tests/qeeprom.py
index a65ca97..cafbc7f 100644
--- a/test-cli/test/tests/qeeprom.py
+++ b/test-cli/test/tests/qeeprom.py
@@ -6,12 +6,14 @@ class Qeeprom(unittest.TestCase):
params = None
__position = None
__eeprompath = None
+ __resultlist = None # resultlist is a python list of python dictionaries
# varlist: position, eeprompath
def __init__(self, testname, testfunc, varlist):
self.params = varlist
super(Qeeprom, self).__init__(testfunc)
self._testMethodDoc = testname
+ self.__resultlist = []
if "position" in varlist:
self.__position = varlist["position"]
else:
@@ -33,13 +35,42 @@ class Qeeprom(unittest.TestCase):
data_rx = p.stdout.decode('ascii')
# compare both values
if data_rx != data_tx:
+ # Both data are different
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: mismatch between written and received values.",
+ "type": "string"
+ }
+ )
self.fail("failed: mismatch between written and received values.")
else:
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: Unable to read from the EEPROM device.",
+ "type": "string"
+ }
+ )
self.fail("failed: Unable to read from the EEPROM device.")
else:
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: Unable to write on the EEPROM device.",
+ "type": "string"
+ }
+ )
self.fail("failed: Unable to write on the EEPROM device.")
+ # Test successful
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "OK",
+ "type": "string"
+ }
+ )
+
def getresults(self):
- # resultlist is a python list of python dictionaries
- resultlist = []
- return resultlist
+ return self.__resultlist