]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- the actual round trip requires password authent set up for the user;
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 17 Sep 2014 16:41:08 +0000 (12:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 17 Sep 2014 16:41:08 +0000 (12:41 -0400)
we don't actually need a round trip test here as we're only testing reflection.

test/dialect/postgresql/test_reflection.py

index 04ac41f1d83f5c006537334686a15ebfd4fb338b..4bc65869424a75beeb962ba9acc8d42cbc7282b0 100644 (file)
@@ -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: