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.
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
Capital letters #32
Capital letters #32
Changes from 12 commits
cf59b79
a97aae0
5b04b5a
c3dd7e9
e185e0b
2ffa58c
5fee69e
3440ca9
6773f0d
a804d52
27ea5b5
911bc26
284bad0
ce63cb5
38be9fb
73e4563
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Improvement: The module docstring does not specify the function’s behavior as clearly as it could. Consider improving the explanation of the function and its purpose.
"""
This function takes a user input string and returns the string with all characters in uppercase.
It handles edge cases where the input is empty or contains only spaces.
"""
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.
I added more description but explaining the edge behavior is mentioned within the tests
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.
Improvement: While this name is clear, it could be more explicit in describing what the function does, such as convert_to_uppercase, to clearly convey that it deals with uppercase conversion. "Capital" can be ambiguous because people might think it deals with capitalization rules (e.g., first letter capitalized), not case swapping.
Suggested Improvement: convert_to_uppercase
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.
done.
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.
Improvement: The use of strip() and then checking if not user_text is good. However, you can directly handle empty strings in the assertion, which makes the function simpler:
Action: Use strip() to handle spaces at the beginning or end of the input more cleanly in the assertion check.
e.g
if not user_text.strip():
raise AssertionError("Entry cannot be empty or just spaces")
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.
I already call strip() when checking for empty strings, so there’s no need to call it again on user_text, it is redundant.
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.
could you add here the Test categories with Standard cases, Edge cases, and Defensive tests
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.
done
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.
The test file’s docstring is minimal and could be expanded to better describe the purpose of the tests.
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.
The purpose of the edge, classical cases and defensive tests is explained below
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.
Improvement: The test class name TestConvertCapitalLetters is clear, but it could be improved to use a more conventional PascalCase naming style.
Action: Use PascalCase for the test class name, e.g., TestConvertToCapital.
class TestConvertToCapital(unittest.TestCase):
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.
done