summaryrefslogtreecommitdiff
path: root/test/dialect/test_mssql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-10-24 12:00:58 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-10-24 12:00:58 -0400
commita29f130be7a1589566547e94c0e283f0210f27ef (patch)
treec08b079cebb5e96c0d2ed734cd9dc5e75e23f96d /test/dialect/test_mssql.py
parent9c0d6c0a2326d00579c87c140890e6a9b65b6d32 (diff)
downloadsqlalchemy-a29f130be7a1589566547e94c0e283f0210f27ef.tar.gz
- mssql+pymssql dialect now honors the "port" portion
of the URL instead of discarding it. [ticket:1952] - testing.only_on() accepts db specs optionally as a list
Diffstat (limited to 'test/dialect/test_mssql.py')
-rw-r--r--test/dialect/test_mssql.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/test/dialect/test_mssql.py b/test/dialect/test_mssql.py
index f9912317c..e766a8301 100644
--- a/test/dialect/test_mssql.py
+++ b/test/dialect/test_mssql.py
@@ -9,7 +9,7 @@ from sqlalchemy import types, exc, schema
from sqlalchemy.orm import *
from sqlalchemy.sql import table, column
from sqlalchemy.databases import mssql
-from sqlalchemy.dialects.mssql import pyodbc, mxodbc
+from sqlalchemy.dialects.mssql import pyodbc, mxodbc, pymssql
from sqlalchemy.engine import url
from sqlalchemy.test import *
from sqlalchemy.test.testing import eq_, emits_warning_on, \
@@ -866,12 +866,10 @@ class MatchTest(TestBase, AssertsCompiledSQL):
class ParseConnectTest(TestBase, AssertsCompiledSQL):
- __only_on__ = 'mssql'
-
@classmethod
def setup_class(cls):
global dialect
- dialect = pyodbc.MSDialect_pyodbc()
+ dialect = pyodbc.dialect()
def test_pyodbc_connect_dsn_trusted(self):
u = url.make_url('mssql://mydsn')
@@ -957,7 +955,27 @@ class ParseConnectTest(TestBase, AssertsCompiledSQL):
connection = dialect.create_connect_args(u)
eq_([['DRIVER={SQL Server};Server=hostspec;Database=database;UI'
'D=username;PWD=password'], {}], connection)
+
+ def test_pymssql_port_setting(self):
+ dialect = pymssql.dialect()
+ u = \
+ url.make_url('mssql+pymssql://scott:tiger@somehost/test')
+ connection = dialect.create_connect_args(u)
+ eq_(
+ [[], {'host': 'somehost', 'password': 'tiger',
+ 'user': 'scott', 'database': 'test'}], connection
+ )
+
+ u = \
+ url.make_url('mssql+pymssql://scott:tiger@somehost:5000/test')
+ connection = dialect.create_connect_args(u)
+ eq_(
+ [[], {'host': 'somehost:5000', 'password': 'tiger',
+ 'user': 'scott', 'database': 'test'}], connection
+ )
+
+ @testing.only_on(['mssql+pyodbc', 'mssql+pymssql'], "FreeTDS specific test")
def test_bad_freetds_warning(self):
engine = engines.testing_engine()