diff --git a/test/test_db.py b/test/test_db.py index dc1d0ce0f..4d451c3f1 100644 --- a/test/test_db.py +++ b/test/test_db.py @@ -654,7 +654,7 @@ class MigrationTest(unittest.TestCase): c = new_lib._connection().cursor() c.execute("select * from items") row = c.fetchone() - self.assertEqual(len(row), len(self.old_fields)) + self.assertEqual(len(row.keys()), len(self.old_fields)) def test_open_with_new_field_adds_column(self): new_lib = beets.library.Library(self.libfile, @@ -662,7 +662,7 @@ class MigrationTest(unittest.TestCase): c = new_lib._connection().cursor() c.execute("select * from items") row = c.fetchone() - self.assertEqual(len(row), len(self.new_fields)) + self.assertEqual(len(row.keys()), len(self.new_fields)) def test_open_with_fewer_fields_leaves_untouched(self): new_lib = beets.library.Library(self.libfile, @@ -670,7 +670,7 @@ class MigrationTest(unittest.TestCase): c = new_lib._connection().cursor() c.execute("select * from items") row = c.fetchone() - self.assertEqual(len(row), len(self.old_fields)) + self.assertEqual(len(row.keys()), len(self.old_fields)) def test_open_with_multiple_new_fields(self): new_lib = beets.library.Library(self.libfile, @@ -678,7 +678,7 @@ class MigrationTest(unittest.TestCase): c = new_lib._connection().cursor() c.execute("select * from items") row = c.fetchone() - self.assertEqual(len(row), len(self.newer_fields)) + self.assertEqual(len(row.keys()), len(self.newer_fields)) def test_open_old_db_adds_album_table(self): conn = sqlite3.connect(self.libfile)