Fix save parser test, and fix error in parsing old saves #124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Old saves that don't have council_positions were failing to parse. Add an existence check for the data structure in _update_council_positions().
The test for a full save parse did not propagate an exception back to the tester, causing false negatives (it only successfully tested the existence of the rust save parser). By setting config.CONFIG.debug_mode to True we hit code that propagates the exception, and the test properly fails when a save fails to parse.
Repro:
python -m pytest test/parser_test.py -k "test_real_save" -s
The stack trace:
This was hidden from all automated tests before!
NB I haven't actually checked the effect in the GUI of skipping
_update_council_positions()
- I haven't played Stellaris since before the council existed :).I'd appreciate a large, end-game 3.10.x (preferably 3.10.2!) save to add to the test cases.