MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_basic_element

Method test_basic_element

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

Source from the content-addressed store, hash-verified

40
41 @testing.variation("type_", ["create_table_as", "create_view"])
42 def test_basic_element(self, src_table, type_: testing.Variation):
43 src = src_table
44 if type_.create_table_as:
45 stmt = CreateTableAs(
46 select(src.c.id, src.c.name),
47 "dst",
48 )
49 elif type_.create_view:
50 stmt = CreateView(
51 select(src.c.id, src.c.name),
52 "dst",
53 )
54 else:
55 type_.fail()
56
57 self.assert_compile(
58 stmt,
59 f'CREATE {"TABLE" if type_.create_table_as else "VIEW"} '
60 f"dst AS SELECT src.id, src.name FROM src",
61 )
62
63 @testing.variation("type_", ["create_table_as", "create_view"])
64 def test_schema_element_qualified(

Callers

nothing calls this directly

Calls 5

CreateTableAsClass · 0.90
selectFunction · 0.90
CreateViewClass · 0.90
assert_compileMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected