diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-30 07:57:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-30 07:57:29 +0000 |
commit | a003430ded2dbfbfb48acd3c17f143cbafeee60a (patch) | |
tree | 9016b0b904b32c46542f48de704b3e536b90e1af /tests/localization/test_ko.py | |
parent | Initial commit. (diff) | |
download | pendulum-a003430ded2dbfbfb48acd3c17f143cbafeee60a.tar.xz pendulum-a003430ded2dbfbfb48acd3c17f143cbafeee60a.zip |
Adding upstream version 2.1.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/localization/test_ko.py')
-rw-r--r-- | tests/localization/test_ko.py | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/localization/test_ko.py b/tests/localization/test_ko.py new file mode 100644 index 0000000..63f03f4 --- /dev/null +++ b/tests/localization/test_ko.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +import pendulum + + +locale = "ko" + + +def test_diff_for_humans(): + with pendulum.test(pendulum.datetime(2016, 8, 29)): + diff_for_humans() + + +def diff_for_humans(): + d = pendulum.now().subtract(seconds=1) + assert d.diff_for_humans(locale=locale) == "1초 전" + + d = pendulum.now().subtract(seconds=2) + assert d.diff_for_humans(locale=locale) == "2초 전" + + d = pendulum.now().subtract(minutes=1) + assert d.diff_for_humans(locale=locale) == "1분 전" + + d = pendulum.now().subtract(minutes=2) + assert d.diff_for_humans(locale=locale) == "2분 전" + + d = pendulum.now().subtract(hours=1) + assert d.diff_for_humans(locale=locale) == "1시간 전" + + d = pendulum.now().subtract(hours=2) + assert d.diff_for_humans(locale=locale) == "2시간 전" + + d = pendulum.now().subtract(days=1) + assert d.diff_for_humans(locale=locale) == "1일 전" + + d = pendulum.now().subtract(days=2) + assert d.diff_for_humans(locale=locale) == "2일 전" + + d = pendulum.now().subtract(weeks=1) + assert d.diff_for_humans(locale=locale) == "1주 전" + + d = pendulum.now().subtract(weeks=2) + assert d.diff_for_humans(locale=locale) == "2주 전" + + d = pendulum.now().subtract(months=1) + assert d.diff_for_humans(locale=locale) == "1개월 전" + + d = pendulum.now().subtract(months=2) + assert d.diff_for_humans(locale=locale) == "2개월 전" + + d = pendulum.now().subtract(years=1) + assert d.diff_for_humans(locale=locale) == "1년 전" + + d = pendulum.now().subtract(years=2) + assert d.diff_for_humans(locale=locale) == "2년 전" + + d = pendulum.now().add(seconds=1) + assert d.diff_for_humans(locale=locale) == "1초 후" + + d = pendulum.now().add(seconds=1) + d2 = pendulum.now() + assert d.diff_for_humans(d2, locale=locale) == "1초 뒤" + assert d2.diff_for_humans(d, locale=locale) == "1초 앞" + + assert d.diff_for_humans(d2, True, locale=locale) == "1초" + assert d2.diff_for_humans(d.add(seconds=1), True, locale=locale) == "2초" |