예제 #1
0
 def testNotInSource(self):
     tmp_stdout = StringIO()
     pattern = 'propos'
     with contextlib.redirect_stdout(tmp_stdout):
         find_in_po(pattern, ('about.po', ),
                    linenum=False,
                    file_match=True,
                    no_messages=False)
     output = tmp_stdout.getvalue()
     self.assertTrue(
         len(output) == 0, "Original text should not contain " + pattern)
예제 #2
0
 def testNotInTranslation(self):
     tmp_stdout = StringIO()
     pattern = 'About'
     with contextlib.redirect_stdout(tmp_stdout):
         find_in_po(pattern, ('about.po', ),
                    linenum=False,
                    file_match=True,
                    no_messages=False,
                    in_translation=True,
                    not_in_source=True)
     output = tmp_stdout.getvalue()
     self.assertTrue(
         len(output) == 0, "Translated text should not contain " + pattern)
예제 #3
0
파일: test_pogrep.py 프로젝트: AFPy/pogrep
def test_not_in_translation(about_po):
    errors, results = find_in_po(
        "About",
        ("about.po", ),
        in_translation=True,
        not_in_source=True,
    )
    assert not errors
    assert not results
예제 #4
0
파일: test_pogrep.py 프로젝트: AFPy/pogrep
def test_in_translation(about_po):
    errors, results = find_in_po(
        "propos",
        ("about.po", ),
        in_translation=True,
        not_in_source=True,
    )
    assert not errors
    assert "about.po" in {result.file for result in results}
예제 #5
0
파일: test_pogrep.py 프로젝트: AFPy/pogrep
def test_not_in_source(about_po):
    errors, results = find_in_po("propos", ("about.po", ))
    assert not errors
    assert not results
예제 #6
0
파일: test_pogrep.py 프로젝트: AFPy/pogrep
def test_in_source(about_po):
    errors, results = find_in_po("About", ("about.po", ))
    assert not errors
    assert "about.po" in {result.file for result in results}