Example #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)
Example #2
0
def test_status_state3(mock_ssh):
    """
    Test if job status is grabbed.
    """

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

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

    output = status(job)

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

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

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

    output = status(job)

    assert output == "Exiting"
Example #4
0
def test_status_state1(mock_ssh):
    """
    Test if job status is grabbed.
    """

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

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

    output = status(job)

    assert output == "Subjob(s) Running"
Example #5
0
def test_status_state11(mock_ssh):
    """
    Test if job status is grabbed.
    """

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

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

    output = status(job)

    assert output == "Subjob Completed Execution/Has Been Deleted"
Example #6
0
def test_status_state12(mock_ssh):
    """
    Test if job status is grabbed.
    """

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

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

    output = status(job)

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

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

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

    output = status(job)

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

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

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

    output = status(job)

    assert output == "Job Moved to New Location"
Example #9
0
def test_status_state7(mock_ssh):
    """
    Test if job status is grabbed.
    """

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

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

    output = status(job)

    assert output == "Suspended"
Example #10
0
def test_status_state4(mock_ssh):
    """
    Test if job status is grabbed.
    """

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

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

    output = status(job)

    assert output == "Job Moved to Server"
Example #11
0
def test_status_state9(mock_ssh):
    """
    Test if job status is grabbed.
    """

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

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

    output = status(job)

    assert output == ("Cycle-Harvesting Job is Suspended Due to Keyboard "
                      "Activity")