test_sqlthread codestyle refactoring
This commit is contained in:
parent
dfde50633e
commit
88f56b50e6
|
@ -235,9 +235,9 @@ class TestUpgradeBitmessageDB(TestSqlBase, unittest.TestCase): # pylint: disabl
|
||||||
if i == 7:
|
if i == 7:
|
||||||
self.test_db.cur.execute('''INSERT INTO inventory VALUES( '', 1, 1, '', 1, '') ''')
|
self.test_db.cur.execute('''INSERT INTO inventory VALUES( '', 1, 1, '', 1, '') ''')
|
||||||
self.test_db.cur.execute('''INSERT INTO pubkeys VALUES( '', 1, '', 1, '') ''')
|
self.test_db.cur.execute('''INSERT INTO pubkeys VALUES( '', 1, '', 1, '') ''')
|
||||||
self.test_db.cur.execute('''INSERT INTO sent
|
self.test_db.cur.execute('''INSERT INTO sent
|
||||||
VALUES( '', '', '', '', '', '', '', 1, 'doingmsgpow', 1, 1, '', 1) ''')
|
VALUES( '', '', '', '', '', '', '', 1, 'doingmsgpow', 1, 1, '', 1) ''')
|
||||||
self.test_db.cur.execute('''INSERT INTO sent
|
self.test_db.cur.execute('''INSERT INTO sent
|
||||||
VALUES( '', '', '', '', '', '', '', 1, 'badkey', 1, 1, '', 1) ''')
|
VALUES( '', '', '', '', '', '', '', 1, 'badkey', 1, 1, '', 1) ''')
|
||||||
self.test_db.conn.commit()
|
self.test_db.conn.commit()
|
||||||
elif i == 9:
|
elif i == 9:
|
||||||
|
@ -282,8 +282,8 @@ class TestUpgradeBitmessageDB(TestSqlBase, unittest.TestCase): # pylint: disabl
|
||||||
answer = (check_column in inventory_schema)
|
answer = (check_column in inventory_schema)
|
||||||
|
|
||||||
# check deleting first20bytesofencryptedmessage column to inventory table
|
# check deleting first20bytesofencryptedmessage column to inventory table
|
||||||
self.assertNotEqual(answer, True, "Column first20bytesofencryptedmessage in table inventory not "\
|
self.assertNotEqual(answer, True,
|
||||||
"deleted in version 3")
|
"Column first20bytesofencryptedmessage in table inventory not deleted in version 3")
|
||||||
|
|
||||||
# check deleting inventory_backup table
|
# check deleting inventory_backup table
|
||||||
self.test_db.cur.execute(''' SELECT count(name) FROM sqlite_master
|
self.test_db.cur.execute(''' SELECT count(name) FROM sqlite_master
|
||||||
|
@ -336,7 +336,8 @@ class TestUpgradeBitmessageDB(TestSqlBase, unittest.TestCase): # pylint: disabl
|
||||||
self.assertEqual(version, 6, "Settings version value not updated")
|
self.assertEqual(version, 6, "Settings version value not updated")
|
||||||
|
|
||||||
# check deleting knownnodes table
|
# check deleting knownnodes table
|
||||||
self.test_db.cur.execute(''' SELECT count(name) FROM sqlite_master WHERE type='table' AND name='knownnodes' ''')
|
self.test_db.cur.execute(''' SELECT count(name) FROM sqlite_master
|
||||||
|
WHERE type='table' AND name='knownnodes' ''')
|
||||||
res = self.test_db.cur.fetchall()[0][0]
|
res = self.test_db.cur.fetchall()[0][0]
|
||||||
self.assertNotEqual(res, 1, "Table knownnodes not deleted in versioning 6")
|
self.assertNotEqual(res, 1, "Table knownnodes not deleted in versioning 6")
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user