예제 #1
0
 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()
예제 #2
0
 def test_getSession(self):
     logger.debug(">>test_getSession")
     DM.init_db()
     session = DM.getSession()
     session.close()
예제 #3
0
 def startDatabase(self):
     logger.debug(">>startDatabase()")
     if not DM.init_db():
         logger.debug("Exiting application")
         sys.exit(app.exec_())
     '''
예제 #4
0
 def test_init_db(self):
     logger.debug(">>test_init_db")
     #DM.getBase()
     DM.init_db()
예제 #5
0
 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()