Exemple #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)
Exemple #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"
Exemple #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"
Exemple #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"
Exemple #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"
Exemple #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"
Exemple #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")
Exemple #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"
Exemple #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"