'characteristic' endpoint now contains 31 in 'possible_values' when appropriate #630
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.
The while loop which generates the 'possible_values' field for the 'characteristic' endpoint does not allow for a value of 31 (the maximum IV value) to be added to 'possible_values'. Adjusting the value this loop compares against rectifies the issue. This specifically affects the second row in the table on https://bulbapedia.bulbagarden.net/wiki/Characteristic , which corresponds to the characteristics with IDs 7-12. Previously their 'possible_values' fields returned [1,6,11,16,21,26]. After changes, they return [1,6,11,16,21,26,31].
Also included is a new test, which tests that 'possible_values' contains the correct values for each of the 5 possible values of 'gene_modulo'.
All tests pass after changes, and when running the API locally, produces the expected results.