MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_insert_column_tableclause

Method test_insert_column_tableclause

test/sql/test_metadata.py:2107–2120  ·  view source on GitHub ↗
(self, positions)

Source from the content-addressed store, hash-verified

2105 ((0,),), ((0, 1),), ((1, 2),), ((3,),), argnames="positions"
2106 )
2107 def test_insert_column_tableclause(self, positions):
2108 t = table(
2109 "t",
2110 column("a", Integer),
2111 column("b", Integer),
2112 column("c", Integer),
2113 )
2114
2115 expected_cols = ["a", "b", "c"]
2116 for pos in positions:
2117 t.insert_column(column(f"i{pos}", Integer), pos)
2118 expected_cols.insert(pos, f"i{pos}")
2119
2120 eq_([c.key for c in t.c], expected_cols)
2121
2122 def test_append_column_existing_name(self):
2123 t = Table("t", MetaData(), Column("col", Integer))

Callers

nothing calls this directly

Calls 5

tableFunction · 0.90
columnFunction · 0.90
eq_Function · 0.90
insert_columnMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected