| 911 | a_eq(unformat("`foo`.`b``a``r`.`baz`"), ["foo", "b`a`r", "baz"]) |
| 912 | |
| 913 | def test_alembic_quote(self): |
| 914 | t1 = Table( |
| 915 | "TableOne", MetaData(), Column("MyCol", Integer, index=True) |
| 916 | ) |
| 917 | t2 = Table( |
| 918 | "some_table", MetaData(), Column("some_col", Integer, index=True) |
| 919 | ) |
| 920 | t3 = Table( |
| 921 | "some_table", MetaData(), Column("some_col", Integer, index=True) |
| 922 | ) |
| 923 | ix3 = Index("my_index", t3.c.some_col) |
| 924 | ix4 = Index("MyIndex", t3.c.some_col) |
| 925 | ix5 = Index(None, t3.c.some_col) |
| 926 | |
| 927 | for idx, expected in [ |
| 928 | (list(t1.indexes)[0], "ix_TableOne_MyCol"), |
| 929 | (list(t2.indexes)[0], "ix_some_table_some_col"), |
| 930 | (ix3, "my_index"), |
| 931 | (ix4, "MyIndex"), |
| 932 | (ix5, "ix_some_table_some_col"), |
| 933 | ]: |
| 934 | eq_( |
| 935 | testing.db.dialect.identifier_preparer.format_constraint( |
| 936 | idx, _alembic_quote=False |
| 937 | ), |
| 938 | expected, |
| 939 | ) |
| 940 | |
| 941 | |
| 942 | class QuotedIdentTest(fixtures.TestBase): |