(self, val_exprs, types=TYPES)
| 442 | return 'DEFAULT' |
| 443 | |
| 444 | def choose_val_expr(self, val_exprs, types=TYPES): |
| 445 | if not val_exprs: |
| 446 | raise Exception('At least on value is required') |
| 447 | if not types: |
| 448 | raise Exception('At least one type is required') |
| 449 | available_types = set(types) & set(val_exprs.by_type) |
| 450 | if not available_types: |
| 451 | raise Exception('None of the provided values return any of the required types') |
| 452 | val_type = self.choose_type(available_types) |
| 453 | return choice(val_exprs.by_type[val_type]) |
| 454 | |
| 455 | def choose_constant(self, return_type=None, allow_null=True): |
| 456 | if not return_type: |
no test coverage detected