MCPcopy Create free account
hub / github.com/Vanderhoof/PyDBML / test_add_index

Method test_add_index

test/test_classes/test_table.py:118–132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

116 t.delete_column(c2)
117
118 def test_add_index(self) -> None:
119 t = Table('products')
120 c1 = Column('id', 'integer')
121 c2 = Column('name', 'varchar2')
122 i1 = Index([c1])
123 i2 = Index([c2])
124 t.add_column(c1)
125 t.add_column(c2)
126 t.add_index(i1)
127 t.add_index(i2)
128 self.assertEqual(i1.table, t)
129 self.assertEqual(i2.table, t)
130 self.assertEqual(t.indexes, [i1, i2])
131 with self.assertRaises(TypeError):
132 t.add_index('wrong_type')
133
134 def test_delete_index(self) -> None:
135 t = Table('products')

Callers

nothing calls this directly

Calls 5

add_columnMethod · 0.95
add_indexMethod · 0.95
TableClass · 0.90
ColumnClass · 0.90
IndexClass · 0.90

Tested by

no test coverage detected