diff options
| author | David Fraser <davidf@j5int.com> | 2016-09-14 15:10:42 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-09-20 13:57:40 -0400 |
| commit | 319c49e64ac52ef559d7a3f630de9291bb89e1dc (patch) | |
| tree | 16c727c6aa1e65713fb5cee13d455c48cc15d239 /test/dialect | |
| parent | 0c90cac2c37453a6688d9c1da62bbfb0bfa13d02 (diff) | |
| download | sqlalchemy-319c49e64ac52ef559d7a3f630de9291bb89e1dc.tar.gz | |
Add exclude_tablespaces argument to Oracle
Allows the SYSTEM and SYSAUX tablespaces to be only
conditionally omitted when doing get_table_names()
and get_temp_table_names().
Change-Id: Ie6995873f05163f2ce473a6a9c2d958a30681b44
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/292
Diffstat (limited to 'test/dialect')
| -rw-r--r-- | test/dialect/test_oracle.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/dialect/test_oracle.py b/test/dialect/test_oracle.py index 1bdddb3bc..82cc107fd 100644 --- a/test/dialect/test_oracle.py +++ b/test/dialect/test_oracle.py @@ -1827,6 +1827,41 @@ class EuroNumericTest(fixtures.TestBase): assert type(test_exp) is type(exp) +class SystemTableTablenamesTest(fixtures.TestBase): + __only_on__ = 'oracle' + __backend__ = True + + def setup(self): + testing.db.execute("create table my_table (id integer)") + testing.db.execute("create global temporary table my_temp_table (id integer)") + testing.db.execute("create table foo_table (id integer) tablespace SYSTEM") + + def teardown(self): + testing.db.execute("drop table my_temp_table") + testing.db.execute("drop table my_table") + testing.db.execute("drop table foo_table") + + def test_table_names_no_system(self): + insp = inspect(testing.db) + eq_( + insp.get_table_names(), ["my_table"] + ) + + def test_temp_table_names_no_system(self): + insp = inspect(testing.db) + eq_( + insp.get_temp_table_names(), ["my_temp_table"] + ) + + def test_table_names_w_system(self): + engine = testing_engine(options={"exclude_tablespaces": ["FOO"]}) + insp = inspect(engine) + eq_( + set(insp.get_table_names()).intersection(["my_table", "foo_table"]), + set(["my_table", "foo_table"]) + ) + + class DontReflectIOTTest(fixtures.TestBase): """test that index overflow tables aren't included in table_names.""" |
