summaryrefslogtreecommitdiff
path: root/test/engine
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2007-10-23 07:38:07 +0000
committerJason Kirtland <jek@discorporate.us>2007-10-23 07:38:07 +0000
commit6378c347994c902f7d4e65e54f2b76d01ce603d2 (patch)
tree1953746106c9fce1f53c16d2638923db5e7f9e7f /test/engine
parent21c6fa79b1e5b19c444c9cdc125d67825759330d (diff)
downloadsqlalchemy-6378c347994c902f7d4e65e54f2b76d01ce603d2.tar.gz
- Added initial version of MaxDB dialect.
- All optional test Sequences are now optional=True
Diffstat (limited to 'test/engine')
-rw-r--r--test/engine/execute.py2
-rw-r--r--test/engine/reflection.py25
-rw-r--r--test/engine/transaction.py12
3 files changed, 20 insertions, 19 deletions
diff --git a/test/engine/execute.py b/test/engine/execute.py
index 28faf1102..6cf3cccd9 100644
--- a/test/engine/execute.py
+++ b/test/engine/execute.py
@@ -18,7 +18,7 @@ class ExecuteTest(PersistTest):
def tearDownAll(self):
metadata.drop_all()
- @testing.supported('sqlite')
+ @testing.supported('sqlite', 'maxdb')
def test_raw_qmark(self):
for conn in (testbase.db, testbase.db.connect()):
conn.execute("insert into users (user_id, user_name) values (?, ?)", (1,"jack"))
diff --git a/test/engine/reflection.py b/test/engine/reflection.py
index af190649c..534cdd2c1 100644
--- a/test/engine/reflection.py
+++ b/test/engine/reflection.py
@@ -11,9 +11,10 @@ class ReflectionTest(PersistTest):
@testing.exclude('mysql', '<', (4, 1, 1))
def testbasic(self):
- use_function_defaults = testbase.db.engine.name == 'postgres' or testbase.db.engine.name == 'oracle'
+ use_function_defaults = testing.against('postgres', 'oracle', 'maxdb')
- use_string_defaults = use_function_defaults or testbase.db.engine.__module__.endswith('sqlite')
+ use_string_defaults = (use_function_defaults or
+ testbase.db.engine.__module__.endswith('sqlite'))
if use_function_defaults:
defval = func.current_date()
@@ -25,12 +26,11 @@ class ReflectionTest(PersistTest):
if use_string_defaults:
deftype2 = String
defval2 = "im a default"
- #deftype3 = DateTime
- # the colon thing isnt working out for PG reflection just yet
- #defval3 = '1999-09-09 00:00:00'
deftype3 = Date
- if testbase.db.engine.name == 'oracle':
+ if testing.against('oracle'):
defval3 = text("to_date('09-09-1999', 'MM-DD-YYYY')")
+ elif testing.against('maxdb'):
+ defval3 = '19990909'
else:
defval3 = '1999-09-09'
else:
@@ -520,7 +520,7 @@ class ReflectionTest(PersistTest):
# There's currently no way to calculate identifier case normalization
# in isolation, so...
- if testbase.db.engine.name in ('firebird', 'oracle'):
+ if testing.against('firebird', 'oracle', 'maxdb'):
check_col = 'TRUE'
else:
check_col = 'true'
@@ -689,7 +689,7 @@ class CreateDropTest(PersistTest):
metadata.drop_all(bind=testbase.db)
class UnicodeTest(PersistTest):
- @testing.unsupported('sybase')
+ @testing.unsupported('sybase', 'maxdb')
def test_basic(self):
try:
# the 'convert_unicode' should not get in the way of the reflection
@@ -747,16 +747,16 @@ class SchemaTest(PersistTest):
assert buf.index("CREATE TABLE someschema.table1") > -1
assert buf.index("CREATE TABLE someschema.table2") > -1
- @testing.supported('mysql','postgres')
+ @testing.supported('maxdb', 'mysql', 'postgres')
def test_explicit_default_schema(self):
engine = testbase.db
schema = engine.dialect.get_default_schema_name(engine)
- #engine.echo = True
- if testbase.db.name == 'mysql':
+ if testing.against('mysql'):
schema = testbase.db.url.database
- else:
+ elif testing.against('postgres'):
schema = 'public'
+
metadata = MetaData(testbase.db)
table1 = Table('table1', metadata,
Column('col1', Integer, primary_key=True),
@@ -768,6 +768,7 @@ class SchemaTest(PersistTest):
metadata.create_all()
metadata.create_all(checkfirst=True)
metadata.clear()
+
table1 = Table('table1', metadata, autoload=True, schema=schema)
table2 = Table('table2', metadata, autoload=True, schema=schema)
metadata.drop_all()
diff --git a/test/engine/transaction.py b/test/engine/transaction.py
index 4c7c5ec04..b11065933 100644
--- a/test/engine/transaction.py
+++ b/test/engine/transaction.py
@@ -160,7 +160,7 @@ class TransactionTest(PersistTest):
connection.close()
- @testing.supported('postgres', 'mysql', 'oracle')
+ @testing.supported('postgres', 'mysql', 'oracle', 'maxdb')
@testing.exclude('mysql', '<', (5, 0, 3))
def testnestedsubtransactionrollback(self):
connection = testbase.db.connect()
@@ -178,7 +178,7 @@ class TransactionTest(PersistTest):
)
connection.close()
- @testing.supported('postgres', 'mysql', 'oracle')
+ @testing.supported('postgres', 'mysql', 'oracle', 'maxdb')
@testing.exclude('mysql', '<', (5, 0, 3))
def testnestedsubtransactioncommit(self):
connection = testbase.db.connect()
@@ -196,7 +196,7 @@ class TransactionTest(PersistTest):
)
connection.close()
- @testing.supported('postgres', 'mysql', 'oracle')
+ @testing.supported('postgres', 'mysql', 'oracle', 'maxdb')
@testing.exclude('mysql', '<', (5, 0, 3))
def testrollbacktosubtransaction(self):
connection = testbase.db.connect()
@@ -636,7 +636,7 @@ class ForUpdateTest(PersistTest):
break
con.close()
- @testing.supported('mysql', 'oracle', 'postgres')
+ @testing.supported('mysql', 'oracle', 'postgres', 'maxdb')
def testqueued_update(self):
"""Test SELECT FOR UPDATE with concurrent modifications.
@@ -698,7 +698,7 @@ class ForUpdateTest(PersistTest):
return errors
- @testing.supported('mysql', 'oracle', 'postgres')
+ @testing.supported('mysql', 'oracle', 'postgres', 'maxdb')
def testqueued_select(self):
"""Simple SELECT FOR UPDATE conflict test"""
@@ -707,7 +707,7 @@ class ForUpdateTest(PersistTest):
sys.stderr.write("Failure: %s\n" % e)
self.assert_(len(errors) == 0)
- @testing.supported('oracle', 'postgres')
+ @testing.supported('oracle', 'postgres', 'maxdb')
def testnowait_select(self):
"""Simple SELECT FOR UPDATE NOWAIT conflict test"""