Skip to content

Commit

Permalink
maybe fix tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
wisp3rwind committed May 4, 2023
1 parent edfbb44 commit 0ca83c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/test_dbcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,33 +190,39 @@ def test_open_with_same_fields_leaves_untouched(self):
c = new_lib._connection().cursor()
c.execute("select * from test")
row = c.fetchone()
c.connection.close()
self.assertEqual(len(row.keys()), len(ModelFixture2._fields))

def test_open_with_new_field_adds_column(self):
new_lib = DatabaseFixture3(self.libfile)
c = new_lib._connection().cursor()
c.execute("select * from test")
row = c.fetchone()
c.connection.close()
self.assertEqual(len(row.keys()), len(ModelFixture3._fields))

def test_open_with_fewer_fields_leaves_untouched(self):
new_lib = DatabaseFixture1(self.libfile)
c = new_lib._connection().cursor()
c.execute("select * from test")
row = c.fetchone()
c.connection.close()
self.assertEqual(len(row.keys()), len(ModelFixture2._fields))

def test_open_with_multiple_new_fields(self):
new_lib = DatabaseFixture4(self.libfile)
c = new_lib._connection().cursor()
c.execute("select * from test")
row = c.fetchone()
c.connection.close()
self.assertEqual(len(row.keys()), len(ModelFixture4._fields))

def test_extra_model_adds_table(self):
new_lib = DatabaseFixtureTwoModels(self.libfile)
try:
new_lib._connection().execute("select * from another")
c = new_lib._connection()
c.execute("select * from another")
c.close()
except sqlite3.OperationalError:
self.fail("select failed")

Expand Down

0 comments on commit 0ca83c8

Please sign in to comment.