From 414bc1c64d05c8a5a26043e707c9c0013100ce4b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 17 Sep 2014 12:41:08 -0400 Subject: - the actual round trip requires password authent set up for the user; we don't actually need a round trip test here as we're only testing reflection. --- test/dialect/postgresql/test_reflection.py | 32 +++++++----------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'test/dialect/postgresql/test_reflection.py') diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 04ac41f1d..4bc658694 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -26,10 +26,15 @@ class ForeignTableReflectionTest(fixtures.TablesTest, AssertsExecutionResults): dblink = config.file_config.get( 'sqla_testing', 'postgres_test_db_link') + testtable = Table( + 'testtable', metadata, + Column('id', Integer, primary_key=True), + Column('data', String(30))) + for ddl in [ "CREATE SERVER test_server FOREIGN DATA WRAPPER postgres_fdw " "OPTIONS (dbname 'test', host '%s')" % dblink, - "CREATE USER MAPPING FOR scott \ + "CREATE USER MAPPING FOR public \ SERVER test_server options (user 'scott', password 'tiger')", "CREATE FOREIGN TABLE test_foreigntable ( " " id INT, " @@ -40,7 +45,7 @@ class ForeignTableReflectionTest(fixtures.TablesTest, AssertsExecutionResults): for ddl in [ 'DROP FOREIGN TABLE test_foreigntable', - 'DROP USER MAPPING FOR scott SERVER test_server', + 'DROP USER MAPPING FOR public SERVER test_server', "DROP SERVER test_server" ]: sa.event.listen(metadata, "before_drop", sa.DDL(ddl)) @@ -51,29 +56,6 @@ class ForeignTableReflectionTest(fixtures.TablesTest, AssertsExecutionResults): eq_(set(table.columns.keys()), set(['id', 'data']), "Columns of reflected foreign table didn't equal expected columns") - def test_foreign_table_select(self): - metadata = MetaData(testing.db) - table = Table('test_foreigntable', metadata, autoload=True) - - with testing.db.begin() as conn: - eq_( - conn.execute(table.select()).fetchall(), - [(89, 'd1',)] - ) - - def test_foreign_table_roundtrip(self): - metadata = MetaData(testing.db) - table = Table('test_foreigntable', metadata, autoload=True) - - with testing.db.begin() as conn: - conn.execute(table.delete()) - conn.execute(table.insert(), {'id': 89, 'data': 'd1'}) - - eq_( - testing.db.execute(table.select()).fetchall(), - [(89, 'd1',)] - ) - def test_get_foreign_table_names(self): inspector = inspect(testing.db) with testing.db.connect() as conn: -- cgit v1.2.1