| 789 | ) |
| 790 | |
| 791 | def test_text(self): |
| 792 | clause = text("select * from table where foo=:bar").bindparams( |
| 793 | bindparam("bar") |
| 794 | ) |
| 795 | c1 = str(clause) |
| 796 | |
| 797 | class Vis(CloningVisitor): |
| 798 | def visit_textclause(self, text): |
| 799 | text.text = text.text + " SOME MODIFIER=:lala" |
| 800 | text._bindparams["lala"] = bindparam("lala") |
| 801 | |
| 802 | clause2 = Vis().traverse(clause) |
| 803 | assert c1 == str(clause) |
| 804 | assert str(clause2) == c1 + " SOME MODIFIER=:lala" |
| 805 | assert list(clause._bindparams.keys()) == ["bar"] |
| 806 | assert set(clause2._bindparams.keys()) == {"bar", "lala"} |
| 807 | |
| 808 | def test_select(self): |
| 809 | s2 = select(t1) |