MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_join

Method test_join

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

Source from the content-addressed store, hash-verified

2953 assert not t2.select().alias("foo").is_derived_from(t1)
2954
2955 def test_join(self):
2956 meta = MetaData()
2957
2958 t1 = Table(
2959 "t1",
2960 meta,
2961 Column("c1", Integer, primary_key=True),
2962 Column("c2", String(30)),
2963 )
2964 t2 = Table(
2965 "t2",
2966 meta,
2967 Column("c1", Integer, primary_key=True),
2968 Column("c2", String(30)),
2969 )
2970 t3 = Table(
2971 "t3",
2972 meta,
2973 Column("c1", Integer, primary_key=True),
2974 Column("c2", String(30)),
2975 )
2976
2977 j1 = t1.join(t2, t1.c.c1 == t2.c.c1)
2978
2979 assert j1.is_derived_from(j1)
2980
2981 assert j1.is_derived_from(t1)
2982
2983 assert j1._annotate({"foo": "bar"}).is_derived_from(j1)
2984
2985 assert not j1.is_derived_from(t3)
2986
2987
2988class AnnotationsTest(fixtures.TestBase):

Callers

nothing calls this directly

Calls 7

MetaDataClass · 0.90
TableClass · 0.90
ColumnClass · 0.90
StringClass · 0.90
joinMethod · 0.45
is_derived_fromMethod · 0.45
_annotateMethod · 0.45

Tested by

no test coverage detected