summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_reflection.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-09-17 12:41:08 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-09-17 12:41:08 -0400
commit414bc1c64d05c8a5a26043e707c9c0013100ce4b (patch)
tree6a83997a6b46badcc5073b48cd5ce94b6f688b14 /test/dialect/postgresql/test_reflection.py
parent8546153d5d0371e452e85b5f10232d75bce04976 (diff)
downloadsqlalchemy-414bc1c64d05c8a5a26043e707c9c0013100ce4b.tar.gz
- 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.
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r--test/dialect/postgresql/test_reflection.py32
1 files changed, 7 insertions, 25 deletions
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: