Commit 5e53b65
committed
test(attempt): add regression tests for reverse_translation_outputs schema
Fixes #1201
The original issue reported `reverse_translation_outputs` appearing with
unexpected values when no translation was active. Investigation confirms
that `_postprocess_attempt()` already gates population behind
`this_attempt.lang != self.lang`, so the field is correctly empty (`[]`)
in non-translation runs.
`as_dict()` always serializes the key (even when empty) to give consumers
a stable schema. These two tests make that contract explicit:
- `test_asdict_always_includes_reverse_translation_outputs`: the key is
always present in the serialized dict, never absent.
- `test_asdict_reverse_translation_outputs_empty_when_no_translation`:
the value is `[]` when no translation is configured.
Signed-off-by: Varun Nuthalapati <nuthalapativarun@gmail.com>1 parent 2e9b3f5 commit 5e53b65
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
0 commit comments