import unittest import sh class Qram(unittest.TestCase): __memSize = "10M" __loops = "1" # varlist: memSize, loops def __init__(self, testname, testfunc, varlist): super(Qram, self).__init__(testfunc) if "memSize" in varlist: self.__memSize = varlist["memSize"] else: raise Exception('memSize param inside Qram must be defined') if "loops" in varlist: self.__loops = varlist["loops"] else: raise Exception('loops param inside Qram must be defined') self._testMethodDoc = testname def execute(self): try: sh.memtester(self.__memSize, "1") except sh.ErrorReturnCode as e: self.fail("failed: could not complete memtester command")