summaryrefslogtreecommitdiff
path: root/tests/messages/test_frontend.py
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2018-05-28 12:34:31 +0300
committerAarni Koskela <akx@iki.fi>2018-05-28 13:01:40 +0300
commit3471306e9cd08214d12e6e4af81d8b9dbcd70874 (patch)
treefd530ee4a8bc98d0aa6764cf8e1e0c56b8b45603 /tests/messages/test_frontend.py
parent28797063ac12b6373afe3e9a797a9fd97f675e12 (diff)
downloadbabel-3471306e9cd08214d12e6e4af81d8b9dbcd70874.tar.gz
frontend, test_frontend: don't use deprecated U read mode on Py3
Diffstat (limited to 'tests/messages/test_frontend.py')
-rw-r--r--tests/messages/test_frontend.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py
index d2e9e35..3e3cc8b 100644
--- a/tests/messages/test_frontend.py
+++ b/tests/messages/test_frontend.py
@@ -28,7 +28,7 @@ import pytest
from babel import __version__ as VERSION
from babel.dates import format_datetime
from babel.messages import frontend, Catalog
-from babel.messages.frontend import CommandLineInterface, extract_messages, update_catalog
+from babel.messages.frontend import CommandLineInterface, extract_messages, update_catalog, po_file_read_mode
from babel.util import LOCALTZ
from babel.messages.pofile import read_po, write_po
from babel._compat import StringIO
@@ -124,7 +124,7 @@ class ExtractMessagesTestCase(unittest.TestCase):
self.cmd.finalize_options()
self.cmd.run()
- with open(self._pot_file(), 'U') as f:
+ with open(self._pot_file(), po_file_read_mode) as f:
catalog = read_po(f)
msg = catalog.get('bar')
self.assertEqual(1, len(msg.locations))
@@ -204,7 +204,7 @@ msgstr[1] ""
'year': time.strftime('%Y'),
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(self._pot_file(), 'U') as f:
+ with open(self._pot_file(), po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -257,7 +257,7 @@ msgstr[1] ""
'year': time.strftime('%Y'),
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(self._pot_file(), 'U') as f:
+ with open(self._pot_file(), po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -315,7 +315,7 @@ msgstr[1] ""
'year': time.strftime('%Y'),
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(self._pot_file(), 'U') as f:
+ with open(self._pot_file(), po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -346,7 +346,7 @@ msgstr[0] ""
msgstr[1] ""
"""
- with open(self._pot_file(), 'U') as f:
+ with open(self._pot_file(), po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -440,7 +440,7 @@ msgstr[1] ""
""" % {'version': VERSION,
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -492,7 +492,7 @@ msgstr[1] ""
""" % {'version': VERSION,
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -546,7 +546,7 @@ msgstr[2] ""
""" % {'version': VERSION,
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -597,7 +597,7 @@ msgstr[0] ""
""" % {'version': VERSION,
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='ja_JP')}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -658,7 +658,7 @@ msgstr[1] ""
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en_US'),
'long_message': long_message}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -718,7 +718,7 @@ msgstr[1] ""
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en_US'),
'long_message': long_message}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -879,7 +879,7 @@ msgstr[1] ""
'year': time.strftime('%Y'),
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(pot_file, 'U') as f:
+ with open(pot_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -930,7 +930,7 @@ msgstr[1] ""
'year': time.strftime('%Y'),
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(pot_file, 'U') as f:
+ with open(pot_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -979,7 +979,7 @@ msgstr[1] ""
'year': time.strftime('%Y'),
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(pot_file, 'U') as f:
+ with open(pot_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -1027,7 +1027,7 @@ msgstr[1] ""
""" % {'version': VERSION,
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -1077,7 +1077,7 @@ msgstr[0] ""
""" % {'version': VERSION,
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
@@ -1127,7 +1127,7 @@ msgstr[2] ""
""" % {'version': VERSION,
'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
tzinfo=LOCALTZ, locale='en')}
- with open(po_file, 'U') as f:
+ with open(po_file, po_file_read_mode) as f:
actual_content = f.read()
self.assertEqual(expected_content, actual_content)