MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_basic_toplevel_resultmap

Method test_basic_toplevel_resultmap

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

Source from the content-addressed store, hash-verified

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