Skip to content

Commit 51fcf09

Browse files
committed
Rename data files for test_msgfmt.Test_multi_input
One po file has Windows type end of lines (crlf), while the other has Unix ones (lf). Their names now reflect that.
1 parent 916aec7 commit 51fcf09

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
file1_fr.po eol=crlf
2-
file2_fr.po eol=lf
1+
file1_fr_crlf.po eol=crlf
2+
file2_fr_lf.po eol=lf
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Lib/test/test_tools/test_msgfmt.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ class Test_multi_input(unittest.TestCase):
132132
def test_no_outputfile(self):
133133
"""Test script without -o option - 1 single file"""
134134
with temp_cwd(None):
135-
shutil.copy(data_dir / 'file2_fr.po', '.')
136-
assert_python_ok(msgfmt, 'file2_fr.po')
135+
shutil.copy(data_dir / 'file2_fr_lf.po', '.')
136+
assert_python_ok(msgfmt, 'file2_fr_lf.po')
137137
self.assertTrue(
138-
filecmp.cmp(data_dir / 'file2_fr.mo', 'file2_fr.mo'),
139-
'Wrong compiled file2_fr.mo')
138+
filecmp.cmp(data_dir / 'file2_fr_lf.mo', 'file2_fr_lf.mo'),
139+
'Wrong compiled file2_fr_lf.mo')
140140

141141
def test_both_with_outputfile(self):
142142
"""Test script with -o option and 2 input files
@@ -149,8 +149,8 @@ def test_both_with_outputfile(self):
149149
"""
150150
with temp_cwd(None):
151151
assert_python_ok(msgfmt, '-o', 'file12.mo',
152-
data_dir / 'file1_fr.po',
153-
data_dir / 'file2_fr.po')
152+
data_dir / 'file1_fr_crlf.po',
153+
data_dir / 'file2_fr_lf.po')
154154
self.assertTrue(
155155
filecmp.cmp(data_dir / 'file12_fr.mo', 'file12.mo'),
156156
'Wrong compiled file12.mo')
@@ -159,21 +159,24 @@ def test_both_without_outputfile(self):
159159
"""Test script without -o option and 2 input files"""
160160

161161
with temp_cwd(None):
162-
shutil.copy(data_dir /'file1_fr.po', '.')
163-
shutil.copy(data_dir /'file2_fr.po', '.')
164-
assert_python_ok(msgfmt, 'file1_fr.po', 'file2_fr.po')
162+
shutil.copy(data_dir /'file1_fr_crlf.po', '.')
163+
shutil.copy(data_dir /'file2_fr_lf.po', '.')
164+
assert_python_ok(msgfmt, 'file1_fr_crlf.po', 'file2_fr_lf.po')
165165
self.assertTrue(
166-
filecmp.cmp(data_dir / 'file1_fr.mo', 'file1_fr.mo'),
167-
'Wrong compiled file1_fr.mo')
166+
filecmp.cmp(data_dir / 'file1_fr_crlf.mo', 'file1_fr_crlf.mo'),
167+
'Wrong compiled file1_fr_crlf.mo')
168168
self.assertTrue(
169-
filecmp.cmp(data_dir / 'file2_fr.mo', 'file2_fr.mo'),
170-
'Wrong compiled file2_fr.mo')
169+
filecmp.cmp(data_dir / 'file2_fr_lf.mo', 'file2_fr_lf.mo'),
170+
'Wrong compiled file2_fr_lf.mo')
171171

172172

173173
def update_catalog_snapshots():
174174
for po_file in data_dir.glob('*.po'):
175175
mo_file = po_file.with_suffix('.mo')
176176
compile_messages(po_file, mo_file)
177+
assert_python_ok(msgfmt, '-o', data_dir /'file12_fr.mo',
178+
data_dir / 'file1_fr_crlf.po',
179+
data_dir / 'file2_fr_lf.po')
177180

178181

179182
if __name__ == '__main__':

0 commit comments

Comments
 (0)