class TestCreateDS_basic(unittest.TestCase): def setUp(self): print " Creation of DS_basic object" def tearDown(self): pass def runTest(self): if single_test: print "\n Initialisation of DS_basic object" self.ds = None self.ds = DS_basic("Test") assert self.ds != None, "Could not instantiate an object for the class" if single_test: print " Default values for instance variables" assert self.ds.ds_name == "Test", "Initialisation of Name failed" assert self.ds.ds_status == "closed", "Initialisation of Status failed" assert self.ds.ds_statInfo == False, "Initialisation of statInfo failed" assert self.ds.ds_numRows == 0, "Initialisation of numRows failes" assert self.ds.ds_processedBytes == 0, "Initialisation of processedBytes failed" assert self.ds.ds_limitRows == -1, "Initialisation of limitRows failed" if single_test: print " Get methods for instance variables" assert self.ds.get_name() == "Test", "Method get_name failed" assert self.ds.get_status() == "closed", "Method get_status failed" assert self.ds.get_statInfo() == False, "Method get_statInfo failed" assert self.ds.get_numRows() == 0, "Method get_numRows failed" assert self.ds.get_processedBytes() == 0, "Method get_processedBytes failed" assert self.ds.get_limitRows() == -1, "Method get_limitRows failed" if single_test: print " Set methods for instance variables" self.ds.set_statInfo(True) assert self.ds.ds_statInfo == True, "Method set_statInfo could not set statInfo" self.ds.set_statInfo(False) assert self.ds.ds_statInfo == False, "Method set_statInfo could not reset statInfo" self.ds.set_limitRows(10) assert self.ds.ds_limitRows == 10, "Method set_limitRows could not set limitRows" self.ds.set_limitRows(-1) assert self.ds.ds_limitRows == -1, "Method set_limitRows could not reset limitRows"