(self)
| 259 | assert not hasattr(c1, "__dict__") |
| 260 | |
| 261 | def test_attribute_sanity(self): |
| 262 | assert hasattr(table1, "c") |
| 263 | assert hasattr(table1.select().subquery(), "c") |
| 264 | assert not hasattr(table1.c.myid.self_group(), "columns") |
| 265 | assert not hasattr(table1.c.myid, "columns") |
| 266 | assert not hasattr(table1.c.myid, "c") |
| 267 | assert not hasattr(table1.select().subquery().c.myid, "c") |
| 268 | assert not hasattr(table1.select().subquery().c.myid, "columns") |
| 269 | assert not hasattr(table1.alias().c.myid, "columns") |
| 270 | assert not hasattr(table1.alias().c.myid, "c") |
| 271 | |
| 272 | assert_raises_message( |
| 273 | exc.InvalidRequestError, |
| 274 | "Scalar Select expression has no " |
| 275 | "columns; use this object directly within a " |
| 276 | "column-level expression.", |
| 277 | getattr, |
| 278 | select(table1.c.myid).scalar_subquery().self_group(), |
| 279 | "columns", |
| 280 | ) |
| 281 | |
| 282 | assert_raises_message( |
| 283 | exc.InvalidRequestError, |
| 284 | "Scalar Select expression has no " |
| 285 | "columns; use this object directly within a " |
| 286 | "column-level expression.", |
| 287 | getattr, |
| 288 | select(table1.c.myid).scalar_subquery(), |
| 289 | "columns", |
| 290 | ) |
| 291 | |
| 292 | def test_table_select(self): |
| 293 | self.assert_compile( |
nothing calls this directly
no test coverage detected