(self, plain_tables, connection)
| 1153 | ) |
| 1154 | |
| 1155 | def test_ddl_hastable(self, plain_tables, connection): |
| 1156 | map_ = { |
| 1157 | None: config.test_schema, |
| 1158 | "foo": config.test_schema, |
| 1159 | "bar": None, |
| 1160 | } |
| 1161 | |
| 1162 | metadata = MetaData() |
| 1163 | Table("t1", metadata, Column("x", Integer)) |
| 1164 | Table("t2", metadata, Column("x", Integer), schema="foo") |
| 1165 | Table("t3", metadata, Column("x", Integer), schema="bar") |
| 1166 | |
| 1167 | conn = connection.execution_options(schema_translate_map=map_) |
| 1168 | metadata.create_all(conn) |
| 1169 | |
| 1170 | insp = inspect(connection) |
| 1171 | is_true(insp.has_table("t1", schema=config.test_schema)) |
| 1172 | is_true(insp.has_table("t2", schema=config.test_schema)) |
| 1173 | is_true(insp.has_table("t3", schema=None)) |
| 1174 | |
| 1175 | conn = connection.execution_options(schema_translate_map=map_) |
| 1176 | |
| 1177 | # if this test fails, the tables won't get dropped. so need a |
| 1178 | # more robust fixture for this |
| 1179 | metadata.drop_all(conn) |
| 1180 | |
| 1181 | insp = inspect(connection) |
| 1182 | is_false(insp.has_table("t1", schema=config.test_schema)) |
| 1183 | is_false(insp.has_table("t2", schema=config.test_schema)) |
| 1184 | is_false(insp.has_table("t3", schema=None)) |
| 1185 | |
| 1186 | def test_option_on_execute(self, plain_tables, connection): |
| 1187 | # provided by metadata fixture provided by plain_tables fixture |
nothing calls this directly
no test coverage detected