(self, connection)
| 599 | assert len(r) == 0 |
| 600 | |
| 601 | def test_expanding_in(self, connection): |
| 602 | users = self.tables.users |
| 603 | connection.execute( |
| 604 | users.insert(), |
| 605 | [ |
| 606 | dict(user_id=7, user_name="jack"), |
| 607 | dict(user_id=8, user_name="fred"), |
| 608 | dict(user_id=9, user_name=None), |
| 609 | ], |
| 610 | ) |
| 611 | |
| 612 | stmt = ( |
| 613 | select(users) |
| 614 | .where(users.c.user_name.in_(bindparam("uname", expanding=True))) |
| 615 | .order_by(users.c.user_id) |
| 616 | ) |
| 617 | |
| 618 | eq_( |
| 619 | connection.execute(stmt, {"uname": ["jack"]}).fetchall(), |
| 620 | [(7, "jack")], |
| 621 | ) |
| 622 | |
| 623 | eq_( |
| 624 | connection.execute(stmt, {"uname": ["jack", "fred"]}).fetchall(), |
| 625 | [(7, "jack"), (8, "fred")], |
| 626 | ) |
| 627 | |
| 628 | eq_(connection.execute(stmt, {"uname": []}).fetchall(), []) |
| 629 | |
| 630 | assert_raises_message( |
| 631 | exc.StatementError, |
| 632 | "'expanding' parameters can't be used with executemany()", |
| 633 | connection.execute, |
| 634 | users.update().where( |
| 635 | users.c.user_name.in_(bindparam("uname", expanding=True)) |
| 636 | ), |
| 637 | [{"uname": ["fred"]}, {"uname": ["ed"]}], |
| 638 | ) |
| 639 | |
| 640 | @testing.requires.no_quoting_special_bind_names |
| 641 | def test_expanding_in_special_chars(self, connection): |
nothing calls this directly
no test coverage detected