diff options
author | Jason Kirtland <jek@discorporate.us> | 2007-09-05 19:39:07 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2007-09-05 19:39:07 +0000 |
commit | c3c79b997b4550c1696aa21ffbbe560c30262677 (patch) | |
tree | dcf967ff10a6a9418f18ae05ee0f3db8cf368f12 /test/dialect/mysql.py | |
parent | 9717c7170917856e07331796d8439d30ac93006e (diff) | |
download | sqlalchemy-c3c79b997b4550c1696aa21ffbbe560c30262677.tar.gz |
Fixed reflection of the empty string for mysql enums.
Diffstat (limited to 'test/dialect/mysql.py')
-rw-r--r-- | test/dialect/mysql.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/dialect/mysql.py b/test/dialect/mysql.py index 1cf6b437c..8a5bac6e6 100644 --- a/test/dialect/mysql.py +++ b/test/dialect/mysql.py @@ -558,6 +558,30 @@ class TypesTest(AssertMixin): enum_table.drop() @testing.supported('mysql') + def test_enum_parse(self): + """More exercises for the ENUM type.""" + + db = testbase.db + enum_table = Table('mysql_enum', MetaData(testbase.db), + Column('e1', mysql.MSEnum("'a'")), + Column('e2', mysql.MSEnum("''")), + Column('e3', mysql.MSEnum("'a'", "''")), + Column('e4', mysql.MSEnum("''", "'a'")), + Column('e5', mysql.MSEnum("''", "'''a'''", "'b''b'"))) + try: + enum_table.create() + reflected = Table('mysql_enum', MetaData(testbase.db), + autoload=True) + for t in enum_table, reflected: + assert t.c.e1.type.enums == ['a'] + assert t.c.e2.type.enums == [''] + assert t.c.e3.type.enums == ['a', ''] + assert t.c.e4.type.enums == ['', 'a'] + assert t.c.e5.type.enums == ['', "''a''", "b''b"] + finally: + enum_table.drop() + + @testing.supported('mysql') @testing.exclude('mysql', '<', (5, 0, 0)) def test_type_reflection(self): # (ask_for, roundtripped_as_if_different) @@ -583,6 +607,7 @@ class TypesTest(AssertMixin): ( mysql.MSBlob(1234), mysql.MSBlob()), ( mysql.MSMediumBlob(),), ( mysql.MSLongBlob(),), + ( mysql.MSEnum("''","'fleem'"), ), ] columns = [Column('c%i' % (i + 1), t[0]) for i, t in enumerate(specs)] |