示例#1
0
def test_wrong_msgcat(po_file):
    """ test if msgcat is not available"""
    environ_saved = os.environ["PATH"]
    os.environ["PATH"] = ""
    with pytest.raises(SystemExit) as sysexit:
        powrap.check_style([po_file])
    os.environ["PATH"] = environ_saved
    assert sysexit.type == SystemExit
    assert sysexit.value.code == 127
示例#2
0
def test_msgcat_error(po_file):
    assert powrap.check_style([po_file]) == []
示例#3
0
def test_fileread_error(po_file):
    assert powrap.check_style([po_file]) == []
示例#4
0
def test_succees_on_good_wrapping(po_file):
    assert powrap.check_style([po_file]) == []
示例#5
0
def test_fail_on_bad_wrapping(po_file):
    assert powrap.check_style([po_file]) == [po_file]
示例#6
0
def test_fileread_error(po_file, capsys):
    assert powrap.check_style([po_file]) == 0
    assert str(po_file) not in capsys.readouterr().err
示例#7
0
def test_succees_on_good_wrapping(po_file, capsys):
    assert powrap.check_style([po_file]) == 0
    assert str(po_file) not in capsys.readouterr().err
示例#8
0
def test_fail_on_bad_wrapping(po_file, capsys):
    assert powrap.check_style([po_file]) == 1
    assert str(po_file) in capsys.readouterr().err