summaryrefslogtreecommitdiff
path: root/test/engine/reflection.py
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/reflection.py
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/reflection.py')
-rw-r--r--test/engine/reflection.py25
1 files changed, 13 insertions, 12 deletions
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()