예제 #1
0
def test_status_except1(mock_ssh):
    """
    Test if SSH Error is handled.
    """

    job = {"user": "******", "jobid": ""}

    mock_ssh.side_effect = exceptions.SSHError("OUT", "ERR")

    with pytest.raises(exceptions.SSHError):

        status(job)
예제 #2
0
def test_status_state3(mock_ssh):
    """
    Test if job status is grabbed.
    """

    job = {"user": "******", "jobid": "953631"}

    mock_ssh.return_value = (out, "", 0)

    output = status(job)

    assert output == "Queued"
예제 #3
0
def test_status_state2(mock_ssh):
    """
    Test if job status is grabbed.
    """

    job = {"user": "******", "jobid": "953601"}

    mock_ssh.return_value = (out, "", 0)

    output = status(job)

    assert output == "Job Exited in Error"
예제 #4
0
def test_status_state1(mock_ssh):
    """
    Test if job status is grabbed.
    """

    job = {"user": "******", "jobid": "953580"}

    mock_ssh.return_value = (out, "", 0)

    output = status(job)

    assert output == "Job Exited Properly"
예제 #5
0
def test_status_state11(mock_ssh):
    """
    Test if job status is grabbed.
    """

    job = {"user": "******", "jobid": "3538341"}

    mock_ssh.return_value = ("", "", 0)

    output = status(job)

    assert output == "Finished"
예제 #6
0
def test_status_state10(mock_ssh):
    """
    Test if job status is grabbed.
    """

    job = {"user": "******", "jobid": "953717"}

    mock_ssh.return_value = (out, "", 0)

    output = status(job)

    assert output == "Zombie Job"
예제 #7
0
def test_status_state9(mock_ssh):
    """
    Test if job status is grabbed.
    """

    job = {"user": "******", "jobid": "953716"}

    mock_ssh.return_value = (out, "", 0)

    output = status(job)

    assert output == ("Waiting for Start Time")
예제 #8
0
def test_status_state8(mock_ssh):
    """
    Test if job status is grabbed.
    """

    job = {"user": "******", "jobid": "953715"}

    mock_ssh.return_value = (out, "", 0)

    output = status(job)

    assert output == "Suspended"
예제 #9
0
def test_status_state7(mock_ssh):
    """
    Test if job status is grabbed.
    """

    job = {"user": "******", "jobid": "953713"}

    mock_ssh.return_value = (out, "", 0)

    output = status(job)

    assert output == "Unknown Status"