(self, plain_tables, metadata)
| 1461 | ) |
| 1462 | |
| 1463 | def test_via_engine(self, plain_tables, metadata): |
| 1464 | with config.db.begin() as connection: |
| 1465 | metadata.create_all(connection) |
| 1466 | |
| 1467 | map_ = { |
| 1468 | None: config.test_schema, |
| 1469 | "foo": config.test_schema, |
| 1470 | "bar": None, |
| 1471 | } |
| 1472 | |
| 1473 | metadata = MetaData() |
| 1474 | t2 = Table("t2", metadata, Column("x", Integer), schema="foo") |
| 1475 | |
| 1476 | with self.sql_execution_asserter(config.db) as asserter: |
| 1477 | eng = config.db.execution_options(schema_translate_map=map_) |
| 1478 | with eng.connect() as conn: |
| 1479 | conn.execute(select(t2.c.x)) |
| 1480 | asserter.assert_( |
| 1481 | CompiledSQL("SELECT __[SCHEMA_foo].t2.x FROM __[SCHEMA_foo].t2") |
| 1482 | ) |
| 1483 | |
| 1484 | |
| 1485 | class ExecutionOptionsTest(fixtures.TestBase): |
nothing calls this directly
no test coverage detected