(self, plain_tables, connection)
| 1213 | ) |
| 1214 | |
| 1215 | def test_ddl_hastable(self, plain_tables, connection): |
| 1216 | map_ = { |
| 1217 | None: config.test_schema, |
| 1218 | "foo": config.test_schema, |
| 1219 | "bar": None, |
| 1220 | } |
| 1221 | |
| 1222 | metadata = MetaData() |
| 1223 | Table("t1", metadata, Column("x", Integer)) |
| 1224 | Table("t2", metadata, Column("x", Integer), schema="foo") |
| 1225 | Table("t3", metadata, Column("x", Integer), schema="bar") |
| 1226 | |
| 1227 | conn = connection.execution_options(schema_translate_map=map_) |
| 1228 | metadata.create_all(conn) |
| 1229 | |
| 1230 | insp = inspect(connection) |
| 1231 | is_true(insp.has_table("t1", schema=config.test_schema)) |
| 1232 | is_true(insp.has_table("t2", schema=config.test_schema)) |
| 1233 | is_true(insp.has_table("t3", schema=None)) |
| 1234 | |
| 1235 | conn = connection.execution_options(schema_translate_map=map_) |
| 1236 | |
| 1237 | # if this test fails, the tables won't get dropped. so need a |
| 1238 | # more robust fixture for this |
| 1239 | metadata.drop_all(conn) |
| 1240 | |
| 1241 | insp = inspect(connection) |
| 1242 | is_false(insp.has_table("t1", schema=config.test_schema)) |
| 1243 | is_false(insp.has_table("t2", schema=config.test_schema)) |
| 1244 | is_false(insp.has_table("t3", schema=None)) |
| 1245 | |
| 1246 | def test_option_on_execute(self, plain_tables, connection): |
| 1247 | # provided by metadata fixture provided by plain_tables fixture |
nothing calls this directly
no test coverage detected