-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Added canonicalize_name() to console/commands/init.py #5076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. Looks good to me 👍
As discussed here my suggestion for a test:
You can take the test_interactive_with_dependencies as an example and play around with adding packages to the repo, give different spelling (upper/lower cases) of the package you search and always expect to find it in the first position.
Used canonicalize_name to standardize the names of all packages in poetry init with interactive dependencies. Given its importance, added a test_canoncalize_name() test to tests/utils/test_helpers.py
For testing purposes
Parameterized a _generate_choice_list_packages fixture in order to call the test with both > 10 and < 10 cases, verifying that output is <= 10 and the package_name has the desired package first in choices
Also added cases for truncation and non-truncation in test_generate_choice_list to ensure the message is printed in only the correct cases
Moved info_string generation logic out of init._generate_choice_list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your contribution. Looks good to me 👍
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Resolves: #5035
Resolves: #5033