Skip to content

Commit

Permalink
test: fix SiteDirector test
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Sep 11, 2024
1 parent bf003b3 commit 3dcfb87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ def _buildQueueDict(
self.queueDict = result["Value"]

# Get list of usable sites within this cycle
print("ASSDAAAAAAAAAAAAAa", self.siteClient)
result = self.siteClient.getUsableSites(siteNames)
print(result)
if not result["OK"]:
return result
siteMaskList = result.get("Value", [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from DIRAC.ConfigurationSystem.Client import ConfigurationData
from DIRAC.Core.Utilities.ProcessPool import S_OK
from DIRAC.ResourceStatusSystem.Client.SiteStatus import SiteStatus
from DIRAC.ResourceStatusSystem.Client.ResourceStatus import ResourceStatus

from DIRAC.WorkloadManagementSystem.Agent.SiteDirector import SiteDirector
from DIRAC.WorkloadManagementSystem.Client import PilotStatus
Expand Down Expand Up @@ -166,6 +167,9 @@ def sd(mocker, config):
mocker.patch(
"DIRAC.WorkloadManagementSystem.Agent.SiteDirector.SiteStatus.getUsableSites", return_values=usableSites
)
mocker.patch(
"DIRAC.WorkloadManagementSystem.Agent.SiteDirector.ResourceStatus.getElementStatus", return_values=usableSites
)
sd = SiteDirector()

# Set logger
Expand All @@ -180,6 +184,7 @@ def sd(mocker, config):

# Set queueDict
sd.siteClient = SiteStatus()
sd.rssClient = ResourceStatus()
sd._buildQueueDict()
return sd

Expand Down

0 comments on commit 3dcfb87

Please sign in to comment.