Skip to content

Commit bb6e0c5

Browse files
committed
Cosmetic improvements (long lines...)
1 parent d45039c commit bb6e0c5

1 file changed

Lines changed: 23 additions & 10 deletions

File tree

Lib/test/test_tools/test_msgfmt.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ def test_translations(self):
6060
self.assertEqual(t.gettext('Multilinestring'), 'Multilinetranslation')
6161
self.assertEqual(t.gettext('"escapes"'), '"translated"')
6262
self.assertEqual(t.gettext('\n newlines \n'), '\n translated \n')
63-
self.assertEqual(t.ngettext('One email sent.', '%d emails sent.', 1), 'One email sent.')
64-
self.assertEqual(t.ngettext('One email sent.', '%d emails sent.', 2), '%d emails sent.')
65-
self.assertEqual(t.npgettext('abc', 'One email sent.', '%d emails sent.', 1), 'One email sent.')
66-
self.assertEqual(t.npgettext('abc', 'One email sent.', '%d emails sent.', 2), '%d emails sent.')
63+
self.assertEqual(t.ngettext('One email sent.', '%d emails sent.', 1),
64+
'One email sent.')
65+
self.assertEqual(t.ngettext('One email sent.', '%d emails sent.', 2),
66+
'%d emails sent.')
67+
self.assertEqual(t.npgettext('abc', 'One email sent.',
68+
'%d emails sent.', 1), 'One email sent.')
69+
self.assertEqual(t.npgettext('abc', 'One email sent.',
70+
'%d emails sent.', 2), '%d emails sent.')
6771

6872
def test_po_with_bom(self):
6973
with temp_cwd():
@@ -157,7 +161,9 @@ def test_no_outputfile(self):
157161
with temp_cwd(None):
158162
shutil.copy(data_dir / 'file2_fr_lf.po', '.')
159163
assert_python_ok(msgfmt, 'file2_fr_lf.po')
160-
self.assertTrue(filecmp.cmp(data_dir / 'file2_fr_lf.mo', 'file2_fr_lf.mo'), 'Wrong compiled file2_fr_lf.mo')
164+
self.assertTrue(filecmp.cmp(
165+
data_dir / 'file2_fr_lf.mo','file2_fr_lf.mo'),
166+
'Wrong compiled file2_fr_lf.mo')
161167

162168
def test_both_with_outputfile(self):
163169
"""Test script with -o option and 2 input files
@@ -169,8 +175,11 @@ def test_both_with_outputfile(self):
169175
Unix endings (lf)
170176
"""
171177
with temp_cwd(None):
172-
assert_python_ok(msgfmt, '-o', 'file12.mo', data_dir / 'file1_fr_crlf.po', data_dir / 'file2_fr_lf.po')
173-
self.assertTrue(filecmp.cmp(data_dir / 'file12_fr.mo', 'file12.mo'))
178+
assert_python_ok(msgfmt, '-o', 'file12.mo',
179+
data_dir / 'file1_fr_crlf.po',
180+
data_dir / 'file2_fr_lf.po')
181+
self.assertTrue(filecmp.cmp(data_dir / 'file12_fr.mo',
182+
'file12.mo'))
174183

175184
def test_both_without_outputfile(self):
176185
"""Test script without -o option and 2 input files"""
@@ -179,8 +188,10 @@ def test_both_without_outputfile(self):
179188
shutil.copy(data_dir / 'file1_fr_crlf.po', '.')
180189
shutil.copy(data_dir / 'file2_fr_lf.po', '.')
181190
assert_python_ok(msgfmt, 'file1_fr_crlf.po', 'file2_fr_lf.po')
182-
self.assertTrue(filecmp.cmp(data_dir / 'file1_fr_crlf.mo', 'file1_fr_crlf.mo'))
183-
self.assertTrue(filecmp.cmp(data_dir / 'file2_fr_lf.mo', 'file2_fr_lf.mo'))
191+
self.assertTrue(filecmp.cmp(data_dir / 'file1_fr_crlf.mo',
192+
'file1_fr_crlf.mo'))
193+
self.assertTrue(filecmp.cmp(data_dir / 'file2_fr_lf.mo',
194+
'file2_fr_lf.mo'))
184195

185196

186197
def make_message_files(mo_file, *po_files):
@@ -202,7 +213,9 @@ def update_catalog_snapshots():
202213
mo_file = po_file.with_suffix('.mo')
203214
make_message_files(mo_file, po_file)
204215
# special processing for file12_fr.mo which results from 2 input files
205-
make_message_files(data_dir / 'file12_fr.mo', data_dir / 'file1_fr_crlf.po', data_dir / 'file2_fr_lf.po')
216+
make_message_files(data_dir / 'file12_fr.mo',
217+
data_dir / 'file1_fr_crlf.po',
218+
data_dir / 'file2_fr_lf.po')
206219

207220

208221
if __name__ == '__main__':

0 commit comments

Comments
 (0)