From f2624867ecbcba7519933fb2bf894608926bb22a Mon Sep 17 00:00:00 2001 From: Tobias Pfeiffer Date: Wed, 16 Nov 2022 17:17:14 +0900 Subject: [PATCH] extend test case --- test/dialect/test_sqlite.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py index 9ed5f64bac..a5e2bec4b7 100644 --- a/test/dialect/test_sqlite.py +++ b/test/dialect/test_sqlite.py @@ -2313,22 +2313,47 @@ class ConstraintReflectionTest(fixtures.TestBase): "create unique index ix_partial on " "foo_with_partial_index (x) where y > 10" ) + conn.exec_driver_sql( + "create unique index ix_no_partial on " + "foo_with_partial_index (x)" + ) + conn.exec_driver_sql( + "create unique index ix_partial2 on " + "foo_with_partial_index (x, y) where " + "y = 10 or abs(x) < 5" + ) inspector = inspect(conn) indexes = inspector.get_indexes("foo_with_partial_index") eq_( indexes, [ + { + "unique": 1, + "name": "ix_no_partial", + "column_names": ["x"], + "dialect_options": {}, + }, { "unique": 1, "name": "ix_partial", "column_names": ["x"], "dialect_options": {"sqlite_where": ANY}, - } + }, + { + "unique": 1, + "name": "ix_partial2", + "column_names": ["x", "y"], + "dialect_options": {"sqlite_where": ANY}, + }, ], ) assert ( - indexes[0]["dialect_options"]["sqlite_where"].text == "y > 10" + indexes[1]["dialect_options"]["sqlite_where"].text == "y > 10" + ) + assert ( + indexes[2]["dialect_options"]["sqlite_where"].text + == "y = 10 or abs(x) < 5" ) def test_unique_constraint_named(self): -- 2.47.3