Skip to content

Commit 445fe30

Browse files
committed
fix: fix test for SJA
1 parent 693ce14 commit 445fe30

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

src/DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class JobCleaningAgent(AgentModule):
4747

4848
def __init__(self, *args, **kwargs):
4949
"""c'tor"""
50-
AgentModule.__init__(self, *args, **kwargs)
50+
super().__init__(*args, **kwargs)
5151

5252
# clients
5353
self.jobDB = None

src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PilotStatusAgent(AgentModule):
3232

3333
def __init__(self, *args, **kwargs):
3434
"""c'tor"""
35-
AgentModule.__init__(self, *args, **kwargs)
35+
super().__init__(*args, **kwargs)
3636

3737
self.jobDB = None
3838
self.pilotDB = None

src/DIRAC/WorkloadManagementSystem/Agent/TaskQueuesAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TaskQueuesAgent(AgentModule):
1717

1818
def __init__(self, *args, **kwargs):
1919
"""c'tor"""
20-
AgentModule.__init__(self, *args, **kwargs)
20+
super().__init__(*args, **kwargs)
2121

2222
# clients
2323
self.tqDB = None

src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ def sja(mocker):
2323
side_effect=lambda x, y=None: y,
2424
create=True,
2525
)
26-
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.JobDB.__init__", side_effect=mockNone)
27-
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.JobLoggingDB.__init__", side_effect=mockNone)
26+
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.JobDB")
27+
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.JobLoggingDB")
2828
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.getSystemInstance", side_effect=mockNone)
29+
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.JobMonitoringClient", return_value=MagicMock())
30+
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.PilotManagerClient", return_value=MagicMock())
31+
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.WMSClient", return_value=MagicMock())
32+
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.getSystemInstance", return_value="/bof/bih")
2933

3034
stalledJobAgent = StalledJobAgent()
3135
stalledJobAgent._AgentModule__configDefaults = mockAM
@@ -41,7 +45,7 @@ def sja(mocker):
4145
def test__sjaFunctions(sja):
4246
"""Testing StalledJobAgent()"""
4347

44-
assert not sja._failSubmittingJobs()["OK"]
45-
assert not sja._kickStuckJobs()["OK"]
46-
assert not sja._failStalledJobs(0)["OK"]
48+
assert sja._failSubmittingJobs()["OK"]
49+
assert sja._kickStuckJobs()["OK"]
50+
assert sja._failStalledJobs(0)["OK"]
4751
assert not sja._markStalledJobs(0)["OK"]

src/DIRAC/WorkloadManagementSystem/Client/WMSAdministratorClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, url=None, **kwargs):
1616
:param kwargs: forwarded to the Base Client class
1717
"""
1818

19-
super(WMSAdministratorClient, self).__init__(**kwargs)
19+
super().__init__(**kwargs)
2020

2121
if not url:
2222
self.serverURL = "WorkloadManagement/WMSAdministrator"

0 commit comments

Comments
 (0)