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