MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_select

Method test_select

test/sql/test_selectable.py:2930–2953  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2928 assert not t1.is_derived_from(t2.alias())
2929
2930 def test_select(self):
2931 meta = MetaData()
2932
2933 t1 = Table(
2934 "t1",
2935 meta,
2936 Column("c1", Integer, primary_key=True),
2937 Column("c2", String(30)),
2938 )
2939 t2 = Table(
2940 "t2",
2941 meta,
2942 Column("c1", Integer, primary_key=True),
2943 Column("c2", String(30)),
2944 )
2945
2946 assert t1.select().is_derived_from(t1)
2947 assert not t2.select().is_derived_from(t1)
2948
2949 assert select(t1, t2).is_derived_from(t1)
2950
2951 assert t1.select().alias("foo").is_derived_from(t1)
2952 assert select(t1, t2).alias("foo").is_derived_from(t1)
2953 assert not t2.select().alias("foo").is_derived_from(t1)
2954
2955 def test_join(self):
2956 meta = MetaData()

Callers

nothing calls this directly

Calls 8

MetaDataClass · 0.90
TableClass · 0.90
ColumnClass · 0.90
StringClass · 0.90
selectFunction · 0.90
is_derived_fromMethod · 0.45
selectMethod · 0.45
aliasMethod · 0.45

Tested by

no test coverage detected