Server for testing various implementation conveniences (auto-boxing, etc.)
| 1291 | |
| 1292 | |
| 1293 | class ConvenienceServer(FlightServerBase): |
| 1294 | """ |
| 1295 | Server for testing various implementation conveniences (auto-boxing, etc.) |
| 1296 | """ |
| 1297 | |
| 1298 | @property |
| 1299 | def simple_action_results(self): |
| 1300 | return [b'foo', b'bar', b'baz'] |
| 1301 | |
| 1302 | def do_action(self, context, action): |
| 1303 | if action.type == 'simple-action': |
| 1304 | return self.simple_action_results |
| 1305 | elif action.type == 'echo': |
| 1306 | return [action.body] |
| 1307 | elif action.type == 'bad-action': |
| 1308 | return ['foo'] |
| 1309 | elif action.type == 'arrow-exception': |
| 1310 | raise pa.ArrowMemoryError() |
| 1311 | elif action.type == 'forever': |
| 1312 | def gen(): |
| 1313 | while not context.is_cancelled(): |
| 1314 | yield b'foo' |
| 1315 | return gen() |
| 1316 | |
| 1317 | |
| 1318 | def test_do_action_result_convenience(): |
no outgoing calls