MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_create_ddl

Method test_create_ddl

test/sql/test_identity_column.py:63–84  ·  view source on GitHub ↗
(self, identity_args, text)

Source from the content-addressed store, hash-verified

61 (dict(cycle=True), "BY DEFAULT AS IDENTITY (CYCLE)"),
62 )
63 def test_create_ddl(self, identity_args, text):
64 if getattr(
65 self, "__dialect__", None
66 ) != "default_enhanced" and testing.against("oracle"):
67 text = text.replace("NO MINVALUE", "NOMINVALUE")
68 text = text.replace("NO MAXVALUE", "NOMAXVALUE")
69 text = text.replace("NO CYCLE", "NOCYCLE")
70
71 t = Table(
72 "foo_table",
73 MetaData(),
74 Column("foo", Integer(), Identity(**identity_args)),
75 )
76 self.assert_compile(
77 CreateTable(t),
78 "CREATE TABLE foo_table (foo INTEGER GENERATED %s)" % text,
79 )
80 t2 = t.to_metadata(MetaData())
81 self.assert_compile(
82 CreateTable(t2),
83 "CREATE TABLE foo_table (foo INTEGER GENERATED %s)" % text,
84 )
85
86 def test_other_options(self):
87 t = Table(

Callers

nothing calls this directly

Calls 10

to_metadataMethod · 0.95
TableClass · 0.90
MetaDataClass · 0.90
ColumnClass · 0.90
IntegerClass · 0.90
IdentityClass · 0.90
CreateTableClass · 0.85
assert_compileMethod · 0.80
againstMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected