()
| 286 | |
| 287 | |
| 288 | def test_simple_method(): |
| 289 | @transformer |
| 290 | class foo_transformer: |
| 291 | class table(ClassArg): |
| 292 | a: int = input_attribute() |
| 293 | |
| 294 | @output_attribute |
| 295 | def b(self) -> int: |
| 296 | return self.a * 10 |
| 297 | |
| 298 | @method |
| 299 | def c(self, arg) -> int: |
| 300 | return (self.a + self.b) * arg |
| 301 | |
| 302 | table = T( |
| 303 | """ |
| 304 | | a |
| 305 | 1 | 1 |
| 306 | 2 | 2 |
| 307 | 3 | 3 |
| 308 | """ |
| 309 | ) |
| 310 | |
| 311 | method_table = foo_transformer(table).table |
| 312 | result = method_table.select(ret=method_table.c(10)) |
| 313 | |
| 314 | assert_table_equality( |
| 315 | result, |
| 316 | T( |
| 317 | """ |
| 318 | | ret |
| 319 | 1 | 110 |
| 320 | 2 | 220 |
| 321 | 3 | 330 |
| 322 | """ |
| 323 | ), |
| 324 | ) |
| 325 | |
| 326 | |
| 327 | def test_select_method_column(): |
nothing calls this directly
no test coverage detected