(self, operator, right)
| 142 | id_="ns", |
| 143 | ) |
| 144 | def test_operate(self, operator, right): |
| 145 | left = column("left") |
| 146 | |
| 147 | if operators.is_comparison(operator): |
| 148 | type_ = sqltypes.BOOLEANTYPE |
| 149 | else: |
| 150 | type_ = sqltypes.NULLTYPE |
| 151 | |
| 152 | assert left.comparator.operate(operator, right).compare( |
| 153 | BinaryExpression( |
| 154 | coercions.expect(roles.WhereHavingRole, left), |
| 155 | coercions.expect(roles.WhereHavingRole, right), |
| 156 | operator, |
| 157 | type_=type_, |
| 158 | ) |
| 159 | ) |
| 160 | |
| 161 | modifiers = operator(left, right).modifiers |
| 162 | |
| 163 | assert operator(left, right).compare( |
| 164 | BinaryExpression( |
| 165 | coercions.expect(roles.WhereHavingRole, left), |
| 166 | coercions.expect(roles.WhereHavingRole, right), |
| 167 | operator, |
| 168 | modifiers=modifiers, |
| 169 | type_=type_, |
| 170 | ) |
| 171 | ) |
| 172 | |
| 173 | self._loop_test(operator, right) |
| 174 | |
| 175 | if operators.is_comparison(operator): |
| 176 | is_( |
| 177 | left.comparator.operate(operator, right).type, |
| 178 | sqltypes.BOOLEANTYPE, |
| 179 | ) |
| 180 | |
| 181 | def _loop_test(self, operator, *arg): |
| 182 | loop = LoopOperate() |
nothing calls this directly
no test coverage detected