Skip to content

Commit

Permalink
Add Persian/Farsi Test in test_locales.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Crimson-Amir authored Oct 19, 2024
1 parent 9038ee3 commit de72006
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,27 @@ def test_timeframes(self):
assert self.locale._format_timeframe("days", 50) == "50 يوم"
assert self.locale._format_timeframe("years", 115) == "115 سنة"

@pytest.mark.usefixtures("lang_locale")
class TestFarsiLocale:
def test_timeframes(self):
assert self.locale._format_timeframe("now", 0) == "اکنون"
# single
assert self.locale._format_timeframe("minute", 1) == "یک دقیقه"
assert self.locale._format_timeframe("hour", 1) == "یک ساعت"
assert self.locale._format_timeframe("day", 1) == "یک روز"
assert self.locale._format_timeframe("week", 1) == "یک هفته"
assert self.locale._format_timeframe("month", 1) == "یک ماه"
assert self.locale._format_timeframe("year", 1) == "یک سال"

# double
assert self.locale._format_timeframe("minutes", 2) == "2 دقیقه"
assert self.locale._format_timeframe("hours", 2) == "2 ساعت"
assert self.locale._format_timeframe("days", 2) == "2 روز"
assert self.locale._format_timeframe("weeks", 2) == "2 هفته"
assert self.locale._format_timeframe("months", 2) == "2 ماه"
assert self.locale._format_timeframe("years", 2) == "2 سال"



@pytest.mark.usefixtures("lang_locale")
class TestNepaliLocale:
Expand Down

0 comments on commit de72006

Please sign in to comment.