Skip to content

Commit 2443773

Browse files
committed
Add TestTurkishLocale
1 parent e68df21 commit 2443773

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

tests/test_locales.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,3 +1611,71 @@ def test_format_relative_future(self):
16111611

16121612
result = self.locale._format_relative("ଏକ ଘଣ୍ଟା", "hour", -1)
16131613
assert result == "ଏକ ଘଣ୍ଟା ପୂର୍ବେ"
1614+
1615+
1616+
@pytest.mark.usefixtures("lang_locale")
1617+
class TestTurkishLocale:
1618+
def test_singles_mk(self):
1619+
assert self.locale._format_timeframe("second", 1) == "bir saniye"
1620+
assert self.locale._format_timeframe("minute", 1) == "bir dakika"
1621+
assert self.locale._format_timeframe("hour", 1) == "bir saat"
1622+
assert self.locale._format_timeframe("day", 1) == "bir gün"
1623+
assert self.locale._format_timeframe("week", 1) == "hafta"
1624+
assert self.locale._format_timeframe("month", 1) == "bir ay"
1625+
assert self.locale._format_timeframe("year", 1) == "yıl"
1626+
1627+
def test_meridians_mk(self):
1628+
assert self.locale.meridian(7, "A") == "ÖÖ"
1629+
assert self.locale.meridian(18, "A") == "ÖS"
1630+
assert self.locale.meridian(10, "a") == "öö"
1631+
assert self.locale.meridian(22, "a") == "ös"
1632+
1633+
def test_describe_mk(self):
1634+
assert self.locale.describe("second", only_distance=True) == "bir saniye"
1635+
assert self.locale.describe("second", only_distance=False) == "bir saniye sonra"
1636+
assert self.locale.describe("minute", only_distance=True) == "bir dakika"
1637+
assert self.locale.describe("minute", only_distance=False) == "bir dakika sonra"
1638+
assert self.locale.describe("hour", only_distance=True) == "bir saat"
1639+
assert self.locale.describe("hour", only_distance=False) == "bir saat sonra"
1640+
assert self.locale.describe("day", only_distance=True) == "bir gün"
1641+
assert self.locale.describe("day", only_distance=False) == "bir gün sonra"
1642+
assert self.locale.describe("week", only_distance=True) == "hafta"
1643+
assert self.locale.describe("week", only_distance=False) == "hafta sonra"
1644+
assert self.locale.describe("month", only_distance=True) == "bir ay"
1645+
assert self.locale.describe("month", only_distance=False) == "bir ay sonra"
1646+
assert self.locale.describe("year", only_distance=True) == "yıl"
1647+
assert self.locale.describe("year", only_distance=False) == "yıl sonra"
1648+
1649+
def test_relative_mk(self):
1650+
assert self.locale._format_relative("şimdi", "now", 0) == "şimdi"
1651+
assert self.locale._format_relative("1 saniye", "seconds", 1) == "1 saniye sonra"
1652+
assert self.locale._format_relative("1 saniye", "seconds", -1) == "1 saniye önce"
1653+
assert self.locale._format_relative("1 dakika", "minutes", 1) == "1 dakika sonra"
1654+
assert self.locale._format_relative("1 dakika", "minutes", -1) == "1 dakika önce"
1655+
assert self.locale._format_relative("1 saat", "hours", 1) == "1 saat sonra"
1656+
assert self.locale._format_relative("1 saat", "hours", -1) == "1 saat önce"
1657+
assert self.locale._format_relative("1 gün", "days", 1) == "1 gün sonra"
1658+
assert self.locale._format_relative("1 gün", "days", -1) == "1 gün önce"
1659+
assert self.locale._format_relative("1 hafta", "weeks", 1) == "1 hafta sonra"
1660+
assert self.locale._format_relative("1 hafta", "weeks", -1) == "1 hafta önce"
1661+
assert self.locale._format_relative("1 ay", "months", 1) == "1 ay sonra"
1662+
assert self.locale._format_relative("1 ay", "months", -1) == "1 ay önce"
1663+
assert self.locale._format_relative("1 yıl", "years", 1) == "1 yıl sonra"
1664+
assert self.locale._format_relative("1 yıl", "years", -1) == "1 yıl önce"
1665+
1666+
def test_plurals_mk(self):
1667+
assert self.locale._format_timeframe("now", 0) == "şimdi"
1668+
assert self.locale._format_timeframe("second", 1) == "bir saniye"
1669+
assert self.locale._format_timeframe("seconds", 30) == "30 saniye"
1670+
assert self.locale._format_timeframe("minute", 1) == "bir dakika"
1671+
assert self.locale._format_timeframe("minutes", 40) == "40 dakika"
1672+
assert self.locale._format_timeframe("hour", 1) == "bir saat"
1673+
assert self.locale._format_timeframe("hours", 23) == "23 saat"
1674+
assert self.locale._format_timeframe("day", 1) == "bir gün"
1675+
assert self.locale._format_timeframe("days", 12) == "12 gün"
1676+
assert self.locale._format_timeframe("week", 1) == "hafta"
1677+
assert self.locale._format_timeframe("weeks", 38) == "38 hafta"
1678+
assert self.locale._format_timeframe("month", 1) == "bir ay"
1679+
assert self.locale._format_timeframe("months", 11) == "11 ay"
1680+
assert self.locale._format_timeframe("year", 1) == "yıl"
1681+
assert self.locale._format_timeframe("years", 12) == "12 yıl"

0 commit comments

Comments
 (0)