Test result row processing when selecting from a plain bind param.
(self, connection)
| 347 | |
| 348 | @testing.requires.standalone_binds |
| 349 | def test_select_from_bindparam(self, connection): |
| 350 | """Test result row processing when selecting from a plain bind |
| 351 | param.""" |
| 352 | |
| 353 | class MyInteger(TypeDecorator): |
| 354 | impl = Integer |
| 355 | cache_ok = True |
| 356 | |
| 357 | def process_bind_param(self, value, dialect): |
| 358 | return int(value[4:]) |
| 359 | |
| 360 | def process_result_value(self, value, dialect): |
| 361 | return "INT_%d" % value |
| 362 | |
| 363 | eq_( |
| 364 | connection.scalar(select(cast("INT_5", type_=MyInteger))), |
| 365 | "INT_5", |
| 366 | ) |
| 367 | eq_( |
| 368 | connection.scalar( |
| 369 | select(cast("INT_5", type_=MyInteger).label("foo")) |
| 370 | ), |
| 371 | "INT_5", |
| 372 | ) |
| 373 | |
| 374 | def test_order_by(self, connection): |
| 375 | """Exercises ORDER BY clause generation. |