def tearDown(self): with io.StringIO() as out: self.db.raw_db.dump(out) print "Table is: \n" + out.getvalue() self.db.drop_table() self.connection.close() AssertDB.tearDown(self)
def setUp(self): AssertDB.setUp(self) self.connection = sqlite3.connect(':memory:') cursor = self.connection.cursor() # Enables foreign_keys support in sqlite cursor.execute("PRAGMA foreign_keys = ON") self.connection.commit() # See the assert at the beginning of this module: # sqlite3.paramstyle == 'qmark' # This means the module uses '?' as the SQL parameter format. self.db = SequencerSQLDB(SQLiteDB('memory', self.connection)) self.db.create_table()
def tearDown(self): # self.db.drop_table() AssertDB.tearDown(self)
def setUp(self): AssertDB.setUp(self) self.basedir = tempfile.mkdtemp(suffix='tmp', prefix='testfiledb') self.db = SequencerFileDB(self.basedir) self.db.create_table()