MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_basic_toplevel_resultmap

Method test_basic_toplevel_resultmap

test/sql/test_text.py:571–593  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

569 )
570
571 def test_basic_toplevel_resultmap(self):
572 t = text("select id, name from user").columns(id=Integer, name=String)
573
574 col_pos = {col.name: idx for idx, col in enumerate(t.selected_columns)}
575
576 compiled = t.compile()
577 eq_(
578 compiled._create_result_map(),
579 {
580 "id": (
581 "id",
582 (t.selected_columns.id, "id", "id", "id"),
583 t.selected_columns.id.type,
584 col_pos["id"],
585 ),
586 "name": (
587 "name",
588 (t.selected_columns.name, "name", "name", "name"),
589 t.selected_columns.name.type,
590 col_pos["name"],
591 ),
592 },
593 )
594
595 def test_basic_subquery_resultmap(self):
596 t = (

Callers

nothing calls this directly

Calls 5

textFunction · 0.90
eq_Function · 0.90
_create_result_mapMethod · 0.80
columnsMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected