diff options
| author | ijl <ijl> | 2013-06-21 00:27:50 -0400 |
|---|---|---|
| committer | ijl <ijl> | 2013-06-21 00:27:50 -0400 |
| commit | 63a85148233bb93dff80873729f7e81bd1a1ca58 (patch) | |
| tree | 6c3961d6073231d531a4ba7327c1ab833266b6e6 /test | |
| parent | 8c555f24b197832b9944f25d47d5989aa942bdea (diff) | |
| download | sqlalchemy-pr/9.tar.gz | |
types.Variant() has a __repr__ usable by Alembicpr/9
Diffstat (limited to 'test')
| -rw-r--r-- | test/sql/test_types.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/sql/test_types.py b/test/sql/test_types.py index dbb475b98..268acd205 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -655,6 +655,35 @@ class VariantTest(fixtures.TestBase, AssertsCompiledSQL): 'fooUTWO' ) + def test_repr(self): + test_objects = ( + (types.String().with_variant( + dialects.mysql.VARCHAR(32, collation='foo', ascii=True), + 'mysql'), + "VARCHAR(collation='foo', ascii=True)"), + (types.Enum('red', 'green', 'blue').with_variant( + dialects.postgresql.ENUM( + 'red', 'green', 'blue', name="rgb_enum", create_type=False), + 'postgresql'), + "ENUM('red', 'green', 'blue', create_type=False, convert_unicode=" + "False, name='rgb_enum', inherit_schema=False)"), + (types.Enum('red', 'green', 'blue').with_variant( + dialects.drizzle.ENUM('red', 'green', 'blue', unicode=True), + 'drizzle'), + "ENUM('red', 'green', 'blue', unicode=True)"), + (types.Integer().with_variant( + dialects.mssql.TINYINT(), + 'mssql'), + "TINYINT()"), + (types.Numeric().with_variant( + dialects.oracle.NUMBER(precision='10', scale='4'), + 'oracle'), + "NUMBER(precision='10', scale='4')") + ) + for obj, result in test_objects: + eq_(repr(obj), result) + + class UnicodeTest(fixtures.TestBase): """Exercise the Unicode and related types. |
