test_sqlthread codestyle refactoring
This commit is contained in:
parent
5803410574
commit
ef0fd969ab
|
@ -36,6 +36,7 @@ class TestSqlBase(object): # pylint: disable=E1101, too-few-public-methods, E10
|
||||||
self.test_db.initialize_schema()
|
self.test_db.initialize_schema()
|
||||||
|
|
||||||
def get_table_schema(self, table_name):
|
def get_table_schema(self, table_name):
|
||||||
|
"""Get table list of column names and value types by table name"""
|
||||||
self.test_db.cur.execute("""PRAGMA table_info({})""".format(table_name))
|
self.test_db.cur.execute("""PRAGMA table_info({})""".format(table_name))
|
||||||
res = self.test_db.cur.fetchall()
|
res = self.test_db.cur.fetchall()
|
||||||
res = [[x[1], x[2]] for x in res]
|
res = [[x[1], x[2]] for x in res]
|
||||||
|
@ -98,7 +99,7 @@ class TestInitializerBitmessageDB(TestSqlBase, unittest.TestCase):
|
||||||
['encodingtype', 'int'],
|
['encodingtype', 'int'],
|
||||||
['read', 'bool'],
|
['read', 'bool'],
|
||||||
['sighash', 'blob']]
|
['sighash', 'blob']]
|
||||||
self.assertEqual(res,check,"inbox table not valid")
|
self.assertEqual(res, check, "inbox table not valid")
|
||||||
|
|
||||||
def test_sent_table_init(self):
|
def test_sent_table_init(self):
|
||||||
"""
|
"""
|
||||||
|
@ -216,6 +217,7 @@ class TestUpgradeBitmessageDB(TestSqlBase, unittest.TestCase): # pylint: disabl
|
||||||
self._setup_db()
|
self._setup_db()
|
||||||
self.test_db.cur.execute('''INSERT INTO settings VALUES('version','2')''')
|
self.test_db.cur.execute('''INSERT INTO settings VALUES('version','2')''')
|
||||||
|
|
||||||
|
|
||||||
def version(self):
|
def version(self):
|
||||||
"""
|
"""
|
||||||
Run SQL Scripts, Initialize DB with respect to versioning
|
Run SQL Scripts, Initialize DB with respect to versioning
|
||||||
|
|
Reference in New Issue
Block a user