summaryrefslogtreecommitdiff
path: root/tests/test_dates.py
diff options
context:
space:
mode:
authorbenselme <benselme@gmail.com>2015-01-09 14:56:31 -0500
committerbenselme <benselme@gmail.com>2015-01-09 14:56:31 -0500
commit9327e0824a1bbed538e73d42b971988f8214b490 (patch)
tree124cc7b279a1b0fe3c01e7939204d03b4fed2610 /tests/test_dates.py
parent071e38a1c9d882e3290430255a5a707d3d9aa8e0 (diff)
downloadbabel-9327e0824a1bbed538e73d42b971988f8214b490.tar.gz
Fixed import and format_timedelta to handle new time unit patterns in cldr-24.
Fixed tests to account for various minor changes in cldr-24.
Diffstat (limited to 'tests/test_dates.py')
-rw-r--r--tests/test_dates.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/test_dates.py b/tests/test_dates.py
index 7b897a1..b18bf50 100644
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
@@ -191,25 +191,25 @@ class DateTimeFormatTestCase(unittest.TestCase):
tz = timezone('Europe/Paris')
dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz)
fmt = dates.DateTimeFormat(dt, locale='fr_FR')
- self.assertEqual('Heure : France', fmt['v'])
+ self.assertEqual('heure : France', fmt['v'])
def test_timezone_location_format(self):
tz = timezone('Europe/Paris')
dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz)
fmt = dates.DateTimeFormat(dt, locale='fr_FR')
- self.assertEqual('Heure : France', fmt['VVVV'])
+ self.assertEqual('heure : France', fmt['VVVV'])
def test_timezone_walltime_short(self):
tz = timezone('Europe/Paris')
t = time(15, 30, tzinfo=tz)
fmt = dates.DateTimeFormat(t, locale='fr_FR')
- self.assertEqual('Heure : France', fmt['v'])
+ self.assertEqual('heure : France', fmt['v'])
def test_timezone_walltime_long(self):
tz = timezone('Europe/Paris')
t = time(15, 30, tzinfo=tz)
fmt = dates.DateTimeFormat(t, locale='fr_FR')
- self.assertEqual(u'heure de l\u2019Europe centrale', fmt['vvvv'])
+ self.assertEqual(u'heure d\u2019Europe centrale', fmt['vvvv'])
def test_hour_formatting(self):
l = 'en_US'
@@ -265,7 +265,6 @@ class FormatTimeTestCase(unittest.TestCase):
formatted_time = dates.format_time(epoch, format='long', locale='en_US')
self.assertEqual(u'3:30:29 PM +0000', formatted_time)
-
def test_with_date_fields_in_pattern(self):
self.assertRaises(AttributeError, dates.format_time, date(2007, 4, 1),
"yyyy-MM-dd HH:mm", locale='en_US')
@@ -305,7 +304,7 @@ class FormatTimedeltaTestCase(unittest.TestCase):
string = dates.format_timedelta(timedelta(hours=1),
locale='en',
add_direction=True)
- self.assertEqual('In 1 hour', string)
+ self.assertEqual('in 1 hour', string)
string = dates.format_timedelta(timedelta(hours=-1),
locale='en',
add_direction=True)
@@ -336,14 +335,14 @@ def test_get_period_names():
def test_get_day_names():
assert dates.get_day_names('wide', locale='en_US')[1] == u'Tuesday'
- assert dates.get_day_names('abbreviated', locale='es')[1] == u'mar'
+ assert dates.get_day_names('abbreviated', locale='es')[1] == u'mar.'
de = dates.get_day_names('narrow', context='stand-alone', locale='de_DE')
assert de[1] == u'D'
def test_get_month_names():
assert dates.get_month_names('wide', locale='en_US')[1] == u'January'
- assert dates.get_month_names('abbreviated', locale='es')[1] == u'ene'
+ assert dates.get_month_names('abbreviated', locale='es')[1] == u'ene.'
de = dates.get_month_names('narrow', context='stand-alone', locale='de_DE')
assert de[1] == u'J'
@@ -477,7 +476,7 @@ def test_format_time():
t = time(15, 30)
paris = dates.format_time(t, format='full',
tzinfo=timezone('Europe/Paris'), locale='fr_FR')
- assert paris == u'15:30:00 heure normale de l\u2019Europe centrale'
+ assert paris == u'15:30:00 heure normale d\u2019Europe centrale'
us_east = dates.format_time(t, format='full',
tzinfo=timezone('US/Eastern'), locale='en_US')
assert us_east == u'3:30:00 PM Eastern Standard Time'