(self)
| 3626 | self.assert_compile(sel3, "(SELECT foo)") |
| 3627 | |
| 3628 | def test_naming(self): |
| 3629 | # TODO: the part where we check c.keys() are not "compile" tests, they |
| 3630 | # belong probably in test_selectable, or some broken up |
| 3631 | # version of that suite |
| 3632 | |
| 3633 | f1 = func.hoho(table1.c.name) |
| 3634 | s1 = select( |
| 3635 | table1.c.myid, |
| 3636 | table1.c.myid.label("foobar"), |
| 3637 | f1, |
| 3638 | func.lala(table1.c.name).label("gg"), |
| 3639 | ) |
| 3640 | |
| 3641 | eq_(list(s1.subquery().c.keys()), ["myid", "foobar", "hoho", "gg"]) |
| 3642 | |
| 3643 | meta = MetaData() |
| 3644 | t1 = Table("mytable", meta, Column("col1", Integer)) |
| 3645 | |
| 3646 | exprs = ( |
| 3647 | table1.c.myid == 12, |
| 3648 | func.hoho(table1.c.myid), |
| 3649 | cast(table1.c.name, Numeric), |
| 3650 | literal("x"), |
| 3651 | ) |
| 3652 | for col, key, expr, lbl in ( |
| 3653 | (table1.c.name, "name", "mytable.name", None), |
| 3654 | ( |
| 3655 | exprs[0], |
| 3656 | "_no_label", |
| 3657 | "mytable.myid = :myid_1", |
| 3658 | "anon_1", |
| 3659 | ), |
| 3660 | (exprs[1], "hoho", "hoho(mytable.myid)", "hoho_1"), |
| 3661 | ( |
| 3662 | exprs[2], |
| 3663 | "name", |
| 3664 | "CAST(mytable.name AS NUMERIC)", |
| 3665 | "name", # due to [ticket:4449] |
| 3666 | ), |
| 3667 | (t1.c.col1, "col1", "mytable.col1", None), |
| 3668 | ( |
| 3669 | column("some wacky thing"), |
| 3670 | "some wacky thing", |
| 3671 | '"some wacky thing"', |
| 3672 | "", |
| 3673 | ), |
| 3674 | ( |
| 3675 | exprs[3], |
| 3676 | "_no_label", |
| 3677 | ":param_1", |
| 3678 | "anon_1", |
| 3679 | ), |
| 3680 | ): |
| 3681 | if getattr(col, "table", None) is not None: |
| 3682 | t = col.table |
| 3683 | else: |
| 3684 | t = table1 |
| 3685 |
nothing calls this directly
no test coverage detected