MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_result_map_subquery

Method test_result_map_subquery

test/sql/test_labels.py:293–313  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

291 self._assert_labeled_table1_select(s)
292
293 def test_result_map_subquery(self):
294 table1 = self.table1
295 s = (
296 table1.select()
297 .where(table1.c.this_is_the_primarykey_column == 4)
298 .alias("foo")
299 )
300 s2 = select(s)
301 compiled = s2.compile(dialect=self._length_fixture())
302 assert set(
303 compiled._create_result_map()["this_is_the_data_column"][1]
304 ).issuperset(["this_is_the_data_column", s.c.this_is_the_data_column])
305 assert set(
306 compiled._create_result_map()["this_is_the_primarykey__1"][1]
307 ).issuperset(
308 [
309 "this_is_the_primarykey_column",
310 "this_is_the_primarykey__1",
311 s.c.this_is_the_primarykey_column,
312 ]
313 )
314
315 def test_result_map_anon_alias(self):
316 table1 = self.table1

Callers

nothing calls this directly

Calls 8

_length_fixtureMethod · 0.95
selectFunction · 0.90
_create_result_mapMethod · 0.80
aliasMethod · 0.45
whereMethod · 0.45
selectMethod · 0.45
compileMethod · 0.45
issupersetMethod · 0.45

Tested by

no test coverage detected