Files
sqlalchemy/test/engine/metadata.py
T
Jason Kirtland 5b779d30c3 - Added testbase.Table and testbase.Column, interceptors that can set up
test-run- and dialect-specific options on those objects
  All tests re-pointed to go through the interceptors
- Removed mysql_engine= from table declarations, replaced with a general
  flag indicating storage requirements
- Added ability to choose a global MySQL storage engine for all tests
  --mysql-engine=<whatever>
  If none is specified, tests use the old db-default/InnoDB behavior
- Added ability to append arbitrary table creation params
  --table-option=KEY=VALUE
  For MySQL 3, use this to set mysql_type instead of --mysql-engine
- Removed a couple dead test modules
2007-06-15 22:35:53 +00:00

19 lines
534 B
Python

import testbase
from sqlalchemy import *
from testbase import Table, Column
class MetaDataTest(testbase.PersistTest):
def test_metadata_connect(self):
metadata = MetaData()
t1 = Table('table1', metadata, Column('col1', Integer, primary_key=True),
Column('col2', String(20)))
metadata.engine = testbase.db
metadata.create_all()
try:
assert t1.count().scalar() == 0
finally:
metadata.drop_all()
if __name__ == '__main__':
testbase.main()