Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AshleyBellomy1
Copy link

Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

  • [x ] 🧪 Added tests for changed code.
  • [ x] 🛠️ All tests pass when run locally (run tox or make test to find out!).
  • [x ] 🧹 All linting checks pass when run locally (run tox -e lint or make lint to find out!).
  • [x ] 📚 Updated documentation for changed code.
  • [x ] ⏩ Code is up-to-date with the 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

@anishnya anishnya self-requested a review February 8, 2022 03:48

def test_format_timeframe(self):
assert self.locale._format_timeframe("now", 0) == "adesso"
assert self.locale._format_timeframe("seconds", 1) == "un secondo"
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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.

Copy link
Member

@anishnya anishnya left a 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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants