コード例 #1
0
ファイル: test_util.py プロジェクト: jamosta/tmuxp
def test_raise_BeforeLoadScriptNotExists_if_not_exists():
    script_file = FIXTURE_PATH / "script_noexists.sh"

    with pytest.raises(BeforeLoadScriptNotExists):
        run_before_script(script_file)

    with pytest.raises(OSError):
        run_before_script(script_file)
コード例 #2
0
ファイル: test_util.py プロジェクト: yargevad/tmuxp
def test_raise_BeforeLoadScriptNotExists_if_not_exists():
    script_file = os.path.join(fixtures_dir, 'script_noexists.sh')

    with pytest.raises(BeforeLoadScriptNotExists):
        run_before_script(script_file)

    with pytest.raises(OSError):
        run_before_script(script_file)
コード例 #3
0
ファイル: test_util.py プロジェクト: digitalsatori/tmuxp
def test_raise_BeforeLoadScriptNotExists_if_not_exists():
    script_file = os.path.join(fixtures_dir, 'script_noexists.sh')

    with pytest.raises(BeforeLoadScriptNotExists):
        run_before_script(script_file)

    with pytest.raises(OSError):
        run_before_script(script_file)
コード例 #4
0
ファイル: test_util.py プロジェクト: yargevad/tmuxp
def test_beforeload_returns_stderr_messages():
    script_file = os.path.join(fixtures_dir, 'script_failed.sh')

    with pytest.raises(exc.BeforeLoadScriptError) as excinfo:
        run_before_script(script_file)
        assert excinfo.match(r'failed with returncode')
コード例 #5
0
ファイル: test_util.py プロジェクト: yargevad/tmuxp
def test_return_stdout_if_ok(capsys):
    script_file = os.path.join(fixtures_dir, 'script_complete.sh')

    run_before_script(script_file)
    out, err = capsys.readouterr()
    assert 'hello' in out
コード例 #6
0
ファイル: test_util.py プロジェクト: yargevad/tmuxp
def test_raise_BeforeLoadScriptError_if_retcode():
    script_file = os.path.join(fixtures_dir, 'script_failed.sh')

    with pytest.raises(BeforeLoadScriptError):
        run_before_script(script_file)
コード例 #7
0
ファイル: test_util.py プロジェクト: jamosta/tmuxp
def test_beforeload_returns_stderr_messages():
    script_file = FIXTURE_PATH / "script_failed.sh"

    with pytest.raises(exc.BeforeLoadScriptError) as excinfo:
        run_before_script(script_file)
        assert excinfo.match(r"failed with returncode")
コード例 #8
0
ファイル: test_util.py プロジェクト: jamosta/tmuxp
def test_return_stdout_if_ok(capsys):
    script_file = FIXTURE_PATH / "script_complete.sh"

    run_before_script(script_file)
    out, err = capsys.readouterr()
    assert "hello" in out
コード例 #9
0
ファイル: test_util.py プロジェクト: jamosta/tmuxp
def test_raise_BeforeLoadScriptError_if_retcode():
    script_file = FIXTURE_PATH / "script_failed.sh"

    with pytest.raises(BeforeLoadScriptError):
        run_before_script(script_file)
コード例 #10
0
ファイル: test_util.py プロジェクト: digitalsatori/tmuxp
def test_beforeload_returns_stderr_messages():
    script_file = os.path.join(fixtures_dir, 'script_failed.sh')

    with pytest.raises(exc.BeforeLoadScriptError) as excinfo:
        run_before_script(script_file)
        assert excinfo.match(r'failed with returncode')
コード例 #11
0
ファイル: test_util.py プロジェクト: digitalsatori/tmuxp
def test_return_stdout_if_ok(capsys):
    script_file = os.path.join(fixtures_dir, 'script_complete.sh')

    run_before_script(script_file)
    out, err = capsys.readouterr()
    assert 'hello' in out
コード例 #12
0
ファイル: test_util.py プロジェクト: digitalsatori/tmuxp
def test_raise_BeforeLoadScriptError_if_retcode():
    script_file = os.path.join(fixtures_dir, 'script_failed.sh')

    with pytest.raises(BeforeLoadScriptError):
        run_before_script(script_file)