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": "953631"} mock_ssh.return_value = (out, "", 0) output = status(job) assert output == "Queued"
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"
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"
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"
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"
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")
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"
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"