added test cases: Spanish, Italian, French#1089
added test cases: Spanish, Italian, French#1089AshleyBellomy1 wants to merge 2 commits intoarrow-py:masterfrom
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.
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.
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.
See comment above about using self.locale._format_timeframe("second", 1)
| def test_ordinal_number(self): | ||
|
|
||
|
|
||
| assert self.locale.ordinal_number(0) == "0ème" |
There was a problem hiding this comment.
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.
anishnya
left a comment
There was a problem hiding this comment.
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:
toxormake testto find out!).tox -e lintormake lintto find out!).masterbranch.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