MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_keyed_gen

Method test_keyed_gen

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

Source from the content-addressed store, hash-verified

506 assert sel3.corresponding_column(l2) is sel3.c.bar
507
508 def test_keyed_gen(self):
509 s = select(keyed)
510 eq_(s.selected_columns.colx.key, "colx")
511
512 eq_(s.selected_columns.colx.name, "x")
513
514 assert (
515 s.selected_columns.corresponding_column(keyed.c.colx)
516 is s.selected_columns.colx
517 )
518 assert (
519 s.selected_columns.corresponding_column(keyed.c.coly)
520 is s.selected_columns.coly
521 )
522 assert (
523 s.selected_columns.corresponding_column(keyed.c.z)
524 is s.selected_columns.z
525 )
526
527 sel2 = s.alias()
528 assert sel2.corresponding_column(keyed.c.colx) is sel2.c.colx
529 assert sel2.corresponding_column(keyed.c.coly) is sel2.c.coly
530 assert sel2.corresponding_column(keyed.c.z) is sel2.c.z
531
532 def test_keyed_label_gen(self):
533 s = select(keyed).set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL)

Callers

nothing calls this directly

Calls 4

selectFunction · 0.90
eq_Function · 0.90
corresponding_columnMethod · 0.45
aliasMethod · 0.45

Tested by

no test coverage detected