diff options
| author | Sławek Ehlert <slafs@op.pl> | 2014-04-02 13:45:53 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-04-02 13:45:53 -0400 |
| commit | 3db84b174ad9a6c7ba64a8dfd1746905651ca04f (patch) | |
| tree | 485491a586a3f30861ca1d34a4bc1cca41b27091 /test/dialect | |
| parent | a14729266a8b3c9b491c41bc1fe1cb03ccad51af (diff) | |
| download | sqlalchemy-3db84b174ad9a6c7ba64a8dfd1746905651ca04f.tar.gz | |
- cx_Oracle.makedsn can now be passed service_name; squash
commit of pr152
Diffstat (limited to 'test/dialect')
| -rw-r--r-- | test/dialect/test_oracle.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/dialect/test_oracle.py b/test/dialect/test_oracle.py index 1e50b9070..3c67f1590 100644 --- a/test/dialect/test_oracle.py +++ b/test/dialect/test_oracle.py @@ -2074,3 +2074,23 @@ class DBLinkReflectionTest(fixtures.TestBase): autoload_with=testing.db, oracle_resolve_synonyms=True) eq_(list(t.c.keys()), ['id', 'data']) eq_(list(t.primary_key), [t.c.id]) + + +class ServiceNameTest(fixtures.TestBase): + __only_on__ = 'oracle+cx_oracle' + + def test_cx_oracle_service_name(self): + url_string = 'oracle+cx_oracle://scott:tiger@host/?service_name=hr' + eng = create_engine(url_string, _initialize=False) + cargs, cparams = eng.dialect.create_connect_args(eng.url) + + assert 'SERVICE_NAME=hr' in cparams['dsn'] + assert 'SID=hr' not in cparams['dsn'] + + def test_cx_oracle_service_name_bad(self): + url_string = 'oracle+cx_oracle://scott:tiger@host/hr1?service_name=hr2' + assert_raises( + exc.InvalidRequestError, + create_engine, url_string, + _initialize=False + ) |
