Skip to content

Commit

Permalink
Add Tests For ChineseCN locale. (arrow-py#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
krisfremen committed Aug 2, 2021
1 parent 326c62c commit 2ade710
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,26 @@ def test_format_timeframe(self):
assert self.locale._format_timeframe("years", 12) == "12年"


@pytest.mark.usefixtures("lang_locale")
class TestChineseCNLocale:
def test_format_timeframe(self):
assert self.locale._format_timeframe("now", 0) == "刚才"
assert self.locale._format_timeframe("second", 1) == "一秒"
assert self.locale._format_timeframe("seconds", 30) == "30秒"
assert self.locale._format_timeframe("minute", 1) == "1分钟"
assert self.locale._format_timeframe("minutes", 40) == "40分钟"
assert self.locale._format_timeframe("hour", 1) == "1小时"
assert self.locale._format_timeframe("hours", 23) == "23小时"
assert self.locale._format_timeframe("day", 1) == "1天"
assert self.locale._format_timeframe("days", 12) == "12天"
assert self.locale._format_timeframe("week", 1) == "一周"
assert self.locale._format_timeframe("weeks", 38) == "38周"
assert self.locale._format_timeframe("month", 1) == "1个月"
assert self.locale._format_timeframe("months", 11) == "11个月"
assert self.locale._format_timeframe("year", 1) == "1年"
assert self.locale._format_timeframe("years", 12) == "12年"


@pytest.mark.usefixtures("lang_locale")
class TestSwahiliLocale:
def test_format_timeframe(self):
Expand Down

0 comments on commit 2ade710

Please sign in to comment.