Beispiel #1
0
    def assertIndexMembers(self, engine, table, index, members):
        self.assertIndexExists(engine, table, index)

        t = db_utils.get_table(engine, table)
        index_columns = None
        for idx in t.indexes:
            if idx.name == index:
                index_columns = idx.columns.keys()
                break

        self.assertEqual(sorted(members), sorted(index_columns))
Beispiel #2
0
    def assertIndexMembers(self, engine, table, index, members):
        self.assertIndexExists(engine, table, index)

        t = db_utils.get_table(engine, table)
        index_columns = None
        for idx in t.indexes:
            if idx.name == index:
                index_columns = idx.columns.keys()
                break

        self.assertEqual(sorted(members), sorted(index_columns))
Beispiel #3
0
 def assertIndexExists(self, engine, table, index):
     t = db_utils.get_table(engine, table)
     index_names = [idx.name for idx in t.indexes]
     self.assertIn(index, index_names)
Beispiel #4
0
 def assertColumnNotExists(self, engine, table, column):
     t = db_utils.get_table(engine, table)
     self.assertNotIn(column, t.c)
Beispiel #5
0
 def assertColumnCount(self, engine, table, columns):
     t = db_utils.get_table(engine, table)
     self.assertEqual(len(t.columns), len(columns))
Beispiel #6
0
 def assertIndexExists(self, engine, table, index):
     t = db_utils.get_table(engine, table)
     index_names = [idx.name for idx in t.indexes]
     self.assertIn(index, index_names)
Beispiel #7
0
 def assertColumnNotExists(self, engine, table, column):
     t = db_utils.get_table(engine, table)
     self.assertNotIn(column, t.c)
Beispiel #8
0
 def assertColumnCount(self, engine, table, columns):
     t = db_utils.get_table(engine, table)
     self.assertEqual(len(t.columns), len(columns))