-
-
Notifications
You must be signed in to change notification settings - Fork 683
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 test cases: Spanish, Italian, French #1089
base: master
Are you sure you want to change the base?
Conversation
|
||
def test_format_timeframe(self): | ||
assert self.locale._format_timeframe("now", 0) == "adesso" | ||
assert self.locale._format_timeframe("seconds", 1) == "un secondo" |
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.
This should be self.locale._format_timeframe("second", 1)
. We use self.locale._format_timeframe("second", 1)
for a string that represents one second.
assert self.locale._format_timeframe("year", -1) == "un año" | ||
assert self.locale._format_timeframe("years", -4) == "4 años" | ||
assert self.locale._format_timeframe("years", -14) == "14 años" | ||
assert self.locale._format_timeframe("seconds", -1) == "hace 1 segundos" |
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.
self.locale._format_timeframe
doesn't handle the relative logic, hence why these tests are failing. If you wanted to check whether strings are properly being formatted in their future or past form, that would be done with self.locale._format_relative
|
||
def test_format_timeframe(self): | ||
assert self.locale._format_timeframe("now", 0) == "maintenant" | ||
assert self.locale._format_timeframe("seconds", 1) == "une seconde" |
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.
See comment above about using self.locale._format_timeframe("second", 1)
|
||
|
||
@pytest.mark.usefixtures("lang_locale") | ||
class TestFrenchLocale: | ||
def test_ordinal_number(self): | ||
|
||
|
||
assert self.locale.ordinal_number(0) == "0ème" |
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.
This is an edge case we're missing within _ordinal_number
method for the FrenchBaseLocale in arrow\locales.py
. Feel free to add the appropriate edge case with this method to fix this.
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.
Hey @AshleyBellomy1. I've left come comments on the PR that go over why the checks are failing. Feel free to ask any questions or clarification if they arise. Thanks for contributing to Arrow :)
Pull Request Checklist
Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:
tox
ormake test
to find out!).tox -e lint
ormake lint
to find out!).master
branch.If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!
Description of Changes