@@ -95,11 +95,27 @@ def test_checks_fuzzy(self):
9595 # the file has 11 errors (with the fuzzy string)
9696 self .assertEquals (len (result [0 ][1 ]), 11 )
9797
98- def test_spelling (self ):
99- """Test spelling on gettext files."""
98+ def test_spelling_id (self ):
99+ """Test spelling on source messages (English) of gettext files."""
100+ po_check = PoCheck ()
101+ po_check .set_spelling_options ('id' , None , local_path ('pwl.txt' ))
102+ result = po_check .check_files ([local_path ('fr_spelling_id.po' )])
103+
104+ # be sure we have 1 file in result
105+ self .assertEquals (len (result ), 1 )
106+
107+ # the file has 2 spelling errors: words "Thsi" and "errro"
108+ errors = result [0 ][1 ]
109+ self .assertEquals (len (errors ), 2 )
110+ for i , word in enumerate (('Thsi' , 'errro' )):
111+ self .assertEquals (errors [i ].idmsg , 'spelling-id' )
112+ self .assertEquals (errors [i ].message , word )
113+
114+ def test_spelling_str (self ):
115+ """Test spelling on translated messages of gettext files."""
100116 po_check = PoCheck ()
101117 po_check .set_spelling_options ('str' , None , local_path ('pwl.txt' ))
102- result = po_check .check_files ([local_path ('fr_spelling .po' ),
118+ result = po_check .check_files ([local_path ('fr_spelling_str .po' ),
103119 local_path ('fr_language.po' )])
104120
105121 # be sure we have 2 files in result
0 commit comments