MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_alias

Method test_alias

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

Source from the content-addressed store, hash-verified

2908 assert not t2.is_derived_from(t1)
2909
2910 def test_alias(self):
2911 meta = MetaData()
2912 t1 = Table(
2913 "t1",
2914 meta,
2915 Column("c1", Integer, primary_key=True),
2916 Column("c2", String(30)),
2917 )
2918 t2 = Table(
2919 "t2",
2920 meta,
2921 Column("c1", Integer, primary_key=True),
2922 Column("c2", String(30)),
2923 )
2924
2925 assert t1.alias().is_derived_from(t1)
2926 assert not t2.alias().is_derived_from(t1)
2927 assert not t1.is_derived_from(t1.alias())
2928 assert not t1.is_derived_from(t2.alias())
2929
2930 def test_select(self):
2931 meta = MetaData()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected