コード例 #1
0
def test_initscript6():
    context = context_wrap(EMPTY_CONTENT)
    context.path = EMPTY_SCRIPT

    with pytest.raises(EmptyFileException) as e_info:
        InitScript(context)
    assert context.path in str(e_info.value)
コード例 #2
0
def test_initscript7():
    context = context_wrap(COMMENTS_CONTENT)
    context.path = COMMENTS_SCRIPT

    with pytest.raises(NotInitscriptException) as e_info:
        InitScript(context)
    assert context.path in str(e_info.value)
    assert "confidence: 0" in str(e_info.value)
コード例 #3
0
def test_initscript1():
    context = context_wrap(NOTINITSCRIPT_CONTENT)
    context.path = NOTINITSCRIPT_SCRIPT

    with pytest.raises(NotInitscriptException) as e_info:
        InitScript(context)
    assert context.path in str(e_info.value)
    assert "confidence: 1" in str(e_info.value)
コード例 #4
0
def test_initscript5():
    context = context_wrap(HINTSONLY_CONTENT)
    context.path = HINTSONLY_SCRIPT

    r = InitScript(context)
    assert r.file_name == "script_hintsonly"
コード例 #5
0
def test_initscript4():
    context = context_wrap(CHKCONFIG_LSB_CONTENT)
    context.path = CHKCONFIG_LSB_SCRIPT

    r = InitScript(context)
    assert r.file_name == "script_chkconfig+lsb"
コード例 #6
0
def test_initscript3():
    context = context_wrap(LSB_CONTENT)
    context.path = LSB_SCRIPT

    r = InitScript(context)
    assert r.file_name == "script_lsb"
コード例 #7
0
def test_initscript2():
    context = context_wrap(CHKCONFIG_CONTENT, path=CHKCONFIG_SCRIPT)
    r = InitScript(context)
    assert r.file_name == "script_chkconfig"