-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Add URL validation contract and error messages #67
base: main
Are you sure you want to change the base?
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.
Please check the existing conflict as well. |
Copilot
AI
left a comment
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 suggestion.
Comments skipped due to low confidence (4)
tests/validations/test_url_validation_contract.py:18
- The test case for 'None' value is not necessary as 'None' is not a valid string input for URL validation. Consider removing this test case.
(None, False),
tests/validations/test_url_validation_contract.py:36
- The test case for 'None' value is not necessary as 'None' is not a valid string input for URL validation. Consider removing this test case.
(None, True),
tests/validations/test_url_validation_contract.py:54
- The test case for 'None' value is not necessary as 'None' is not a valid string input for URL validation. Consider removing this test case.
(None, True),
tests/validations/test_url_validation_contract.py:72
- The test case for 'None' value is not necessary as 'None' is not a valid string input for URL validation. Consider removing this test case.
(None, True),
@@ -1,5 +1,10 @@ | |||
from flunt.constants import MAX_LENGTH, REQUIRED | |||
|
|||
IS_URL_ERROR_MESSAGE = lambda key: f"{key} is not a valid URL." | |||
IS_URL_OR_EMPTY_ERROR_MESSAGE = lambda key: f"{key} is not a valid URL or empty." | |||
IS_NOT_URL_ERROR_MESSAGE = lambda key: f"{key} is a valid URL." |
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 error message 'key is a valid URL' is unclear. It should be changed to 'key should not be a valid URL.'
IS_NOT_URL_ERROR_MESSAGE = lambda key: f"{key} is a valid URL." | |
IS_NOT_URL_ERROR_MESSAGE = lambda key: f"{key} should not be a valid URL." |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Description
Proposed Changes
Fixed issue #33 by adding the necessary error messages, classes, and methods to add the UrlValidationContract.
Review Checklist
Additional Comments (optional)
Related Issue
#33
Closes #33