File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1010
1111import filecmp
1212import json
13+ import os .path
1314import shutil
1415import sys
1516import unittest
@@ -187,6 +188,28 @@ def test_both_without_outputfile(self):
187188 'file2_fr_lf.mo' ))
188189
189190
191+ class PONamesTest (unittest .TestCase ):
192+ def test_no_extension (self ):
193+ with temp_cwd (None ):
194+ shutil .copy (data_dir / 'file1_fr_crlf.po' , 'file1.fr.po' )
195+ assert_python_ok (msgfmt , 'file1.fr' )
196+ self .assertTrue (os .path .exists ('file1.fr.mo' ))
197+
198+ def test_wrong_extension (self ):
199+ with temp_cwd (None ):
200+ shutil .copy (data_dir / 'file1_fr_crlf.po' , 'file1_fr.pox' )
201+ assert_python_failure (msgfmt , 'file1_fr.pox' )
202+ self .assertFalse (os .path .exists ('file1_fr.mo' ))
203+ self .assertFalse (os .path .exists ('file1_fr.pox.mo' ))
204+
205+ @unittest .skipUnless (sys .platform .startswith ("win" ), "uppercase on Windows" )
206+ def test_MAJ_on_Windows (self ):
207+ with temp_cwd (None ):
208+ shutil .copy (data_dir / 'file1_fr_crlf.po' , 'File1.PO' )
209+ assert_python_ok (msgfmt , 'FIle1.Po' )
210+ self .assertTrue (os .path .exists ('file1.mo' ))
211+
212+
190213def make_message_files (mo_file , * po_files ):
191214 compile_messages (mo_file , * po_files )
192215 # Create a human-readable JSON file which is
You can’t perform that action at this time.
0 commit comments