Server for testing various implementation conveniences (auto-boxing, etc.)
| 1329 | |
| 1330 | |
| 1331 | class ConvenienceServer(FlightServerBase): |
| 1332 | """ |
| 1333 | Server for testing various implementation conveniences (auto-boxing, etc.) |
| 1334 | """ |
| 1335 | |
| 1336 | @property |
| 1337 | def simple_action_results(self): |
| 1338 | return [b'foo', b'bar', b'baz'] |
| 1339 | |
| 1340 | def do_action(self, context, action): |
| 1341 | if action.type == 'simple-action': |
| 1342 | return self.simple_action_results |
| 1343 | elif action.type == 'echo': |
| 1344 | return [action.body] |
| 1345 | elif action.type == 'bad-action': |
| 1346 | return ['foo'] |
| 1347 | elif action.type == 'arrow-exception': |
| 1348 | raise pa.ArrowMemoryError() |
| 1349 | elif action.type == 'forever': |
| 1350 | def gen(): |
| 1351 | while not context.is_cancelled(): |
| 1352 | yield b'foo' |
| 1353 | return gen() |
| 1354 | |
| 1355 | |
| 1356 | def test_do_action_result_convenience(): |
no outgoing calls