MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_quoting

Method test_quoting

test/sql/test_table_via_select.py:90–120  ·  view source on GitHub ↗
(self, type_: testing.Variation)

Source from the content-addressed store, hash-verified

88
89 @testing.variation("type_", ["create_table_as", "create_view"])
90 def test_quoting(self, type_: testing.Variation):
91
92 src = Table(
93 "SourceTable",
94 MetaData(),
95 Column("Some Name", Integer),
96 Column("Other Col", String),
97 )
98 if type_.create_table_as:
99 stmt = CreateTableAs(
100 select(src),
101 "My Analytic Table",
102 schema="Analysis",
103 )
104 elif type_.create_view:
105 stmt = CreateView(
106 select(src),
107 "My Analytic View",
108 schema="Analysis",
109 )
110 else:
111 type_.fail()
112
113 self.assert_compile(
114 stmt,
115 f'CREATE {"TABLE" if type_.create_table_as else "VIEW"} '
116 f'"Analysis"."My Analytic '
117 f'{"Table" if type_.create_table_as else "View"}" AS SELECT '
118 f'"SourceTable"."Some Name", "SourceTable"."Other Col" '
119 f'FROM "SourceTable"',
120 )
121
122 @testing.variation("type_", ["create_table_as", "create_view"])
123 def test_blank_schema_treated_as_none(

Callers

nothing calls this directly

Calls 8

TableClass · 0.90
MetaDataClass · 0.90
ColumnClass · 0.90
CreateTableAsClass · 0.90
selectFunction · 0.90
CreateViewClass · 0.90
assert_compileMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected