Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added length parameter to checkbox and list #137

Closed
wants to merge 2 commits into from
Closed

Added length parameter to checkbox and list #137

wants to merge 2 commits into from

Conversation

domwhewell
Copy link

In the same way @tmsteen did on an older version of the code I have re-added their length parameter to lists and checkboxes in the latest version of the code.
Again to address #80

inquirer/render/console/base.py Show resolved Hide resolved
if self.MAX_OPTIONS_DISPLAYED_AT_ONCE % 2 == 0:
ending_milestone = max(len(choices) - self.half_options, self.half_options + 1)
else:
ending_milestone = max(len(choices) - self.half_options, self.half_options)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you introduces a new code branch here, would be nice to have a test case when self.MAX_OPTIONS_DISPLAYED_AT_ONCE is odd.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry im not sure what you mean?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@domwhewell this IF statement is new on the code, so we should have one test that goes to the IF and on that goes to ELSE to maintain the code coverage of test.

@staticdev
Copy link
Collaborator

Thanks a lot @domwhewell. I checked the code, looks good and I made some comments also.

@domwhewell domwhewell closed this by deleting the head repository Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants