Exemplo n.º 1
0
 def tearDown(self):
     """Delete test messages"""
     dbConn, dbcursor = dbConnManage.dbConnect()
     sqlStr = 'DELETE FROM messages WHERE "message" LIKE "%' + TestMessageModel.messageStr + '%";'
     dbcursor.execute(sqlStr)
     dbConnManage.dbClose(dbConn)
     print("TEST TEARDOWN")
Exemplo n.º 2
0
	def tearDown(self):
		"""Delete test messages"""
		dbConn, dbcursor = dbConnManage.dbConnect()
		sqlStr = 'DELETE FROM messages WHERE "message" LIKE "%' + TestMessageModel.messageStr + '%";'
		dbcursor.execute(sqlStr)
		dbConnManage.dbClose(dbConn)
		print("TEST TEARDOWN")
Exemplo n.º 3
0
def setupDB():
    """	Initialize the database if it does not exist yet"""
    if not os.path.isfile(globalVars.dbPath):
        logging.error("Database Missing")
        dbConn, dbcursor = dbConnection.dbConnect()

        dbcursor.execute('CREATE TABLE "messages" (\
			"message"  ,\
			"timestamp"  ,\
			"index"  INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL\
		);')

        dbConnection.dbClose(dbConn)
        logging.info("Database generated")
Exemplo n.º 4
0
def setupDB():
	"""	Initialize the database if it does not exist yet"""
	if not os.path.isfile(globalVars.dbPath):
		logging.error("Database Missing")
		dbConn, dbcursor = dbConnection.dbConnect()

		dbcursor.execute('CREATE TABLE "messages" (\
			"message"  ,\
			"timestamp"  ,\
			"index"  INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL\
		);')

		dbConnection.dbClose(dbConn)
		logging.info("Database generated")