def test_write(self): logger.debug("--test_write() ") DM.init_db() session = DM.getSession() well = Well() well.name = "Hampo" well.depth_reference = "MDKB" well.elevation_of_depth_reference = "24.0" session.add(well) session.commit() logger.debug("--test_write() id: " + str(well.id)) dummy = session.query(Well).filter(Well.name == 'Hampo').one() logger.debug("--test_write() dummy: " + str(dummy.name) + " object: " + str(dummy)) self.assertEqual("Hampo", dummy.name) session.close()
def test_getSession(self): logger.debug(">>test_getSession") DM.init_db() session = DM.getSession() session.close()
def startDatabase(self): logger.debug(">>startDatabase()") if not DM.init_db(): logger.debug("Exiting application") sys.exit(app.exec_()) '''
def test_init_db(self): logger.debug(">>test_init_db") #DM.getBase() DM.init_db()
def setupDatabase(self): ''' re-create database for each test method ''' logger.debug(">>setupDatabase() ") DM.init_db() #need to create defaults as required by plotting - this hard codes all as default, TODO make it flexible defaultsInitialiser = DefaultsInitialiser()