MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_reduce

Method test_reduce

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

Source from the content-addressed store, hash-verified

2562
2563class ReduceTest(fixtures.TestBase, AssertsExecutionResults):
2564 def test_reduce(self):
2565 meta = MetaData()
2566 t1 = Table(
2567 "t1",
2568 meta,
2569 Column("t1id", Integer, primary_key=True),
2570 Column("t1data", String(30)),
2571 )
2572 t2 = Table(
2573 "t2",
2574 meta,
2575 Column("t2id", Integer, ForeignKey("t1.t1id"), primary_key=True),
2576 Column("t2data", String(30)),
2577 )
2578 t3 = Table(
2579 "t3",
2580 meta,
2581 Column("t3id", Integer, ForeignKey("t2.t2id"), primary_key=True),
2582 Column("t3data", String(30)),
2583 )
2584
2585 eq_(
2586 util.column_set(
2587 sql_util.reduce_columns(
2588 [
2589 t1.c.t1id,
2590 t1.c.t1data,
2591 t2.c.t2id,
2592 t2.c.t2data,
2593 t3.c.t3id,
2594 t3.c.t3data,
2595 ]
2596 )
2597 ),
2598 util.column_set(
2599 [t1.c.t1id, t1.c.t1data, t2.c.t2data, t3.c.t3data]
2600 ),
2601 )
2602
2603 def test_reduce_selectable(self):
2604 metadata = MetaData()

Callers

nothing calls this directly

Calls 7

MetaDataClass · 0.90
TableClass · 0.90
ColumnClass · 0.90
StringClass · 0.90
ForeignKeyClass · 0.90
eq_Function · 0.90
reduce_columnsMethod · 0.80

Tested by

no test coverage detected