Beispiel #1
0
def test_doMaster(mocker):
    """ tests the doMaster method
  """

    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getGOCSites",
        return_value=S_OK())
    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getStorageElementsHosts",
        return_value=S_OK())
    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getFTS3Servers",
        return_value=S_OK())
    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getGOCSites",
        return_value=S_OK())
    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getCESiteMapping",
        return_value=S_OK())

    command = DowntimeCommand(
        {
            'element': 'Resource',
            'name': '669 devel.edu.mk',
            'elementType': 'Z'
        }, {
            'GOCDBClient': mock_GOCDBClient,
            'ResourceManagementClient': mock_RMClient
        })
    res = command.doMaster()
    assert res['OK'] is True
Beispiel #2
0
def test_doMaster(mocker):
    """tests the doMaster method"""

    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getGOCSites",
        return_value=S_OK())
    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getStorageElementsHosts",
        return_value=S_OK())
    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getFTS3Servers",
        return_value=S_OK())
    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getGOCSites",
        return_value=S_OK())
    mocker.patch(
        "DIRAC.ResourceStatusSystem.Command.DowntimeCommand.getCESiteMapping",
        return_value=S_OK())

    command = DowntimeCommand(
        {
            "element": "Resource",
            "name": "669 devel.edu.mk",
            "elementType": "Z"
        },
        {
            "GOCDBClient": mock_GOCDBClient,
            "ResourceManagementClient": mock_RMClient
        },
    )
    res = command.doMaster()
    assert res["OK"] is True