Exemple #1
0
def test__rescheduleFailedJob(mocker, mockJMInput, expected):
    """Testing JobAgent()._rescheduleFailedJob()"""
    mocker.patch(
        "DIRAC.WorkloadManagementSystem.Agent.JobAgent.AgentModule.__init__")
    jobAgent = JobAgent("Test", "Test1")

    jobID = 101
    message = "Test"

    jobAgent.log = gLogger
    jobAgent.log.setLevel("DEBUG")

    result = jobAgent._rescheduleFailedJob(jobID, message)
    result = jobAgent._finish(result["Message"], False)

    assert result == expected
Exemple #2
0
def test__rescheduleFailedJob(mocker, mockJMInput, expected):
  """ Testing JobAgent()._rescheduleFailedJob()
  """

  mockJM.return_value = mockJMInput

  mocker.patch("DIRAC.WorkloadManagementSystem.Agent.JobAgent.AgentModule.__init__")
  mocker.patch("DIRAC.WorkloadManagementSystem.Agent.JobAgent.JobManagerClient.executeRPC", side_effect=mockJM)

  jobAgent = JobAgent('Test', 'Test1')

  jobID = 101
  message = 'Test'

  jobAgent.log = gLogger
  jobAgent.log.setLevel('DEBUG')

  result = jobAgent._rescheduleFailedJob(jobID, message, stop=False)

  assert result == expected