Exemple #1
0
def test_ResourcesGetters():
    res = Resources.getSites()
    assert res['OK'] is True, res['Message']
    assert res['Value'] == ['DIRAC.Jenkins.ch'], res['Value']

    res = Resources.getSiteCEMapping()
    assert res['OK'] is True, res['Message']
    assert res['Value'] == {
        'DIRAC.Jenkins.ch': ['jenkins.cern.ch']
    }, res['Value']

    res = Resources.getCESiteMapping()
    assert res['OK'] is True, res['Message']
    assert res['Value'] == {
        'jenkins.cern.ch': 'DIRAC.Jenkins.ch'
    }, res['Value']

    res = Resources.getCESiteMapping('jenkins.cern.ch')
    assert res['OK'] is True, res['Message']
    assert res['Value'] == {
        'jenkins.cern.ch': 'DIRAC.Jenkins.ch'
    }, res['Value']

    res = Resources.getCESiteMapping('not-here')
    assert res['OK'] is True, res['Message']
    assert res['Value'] == {}, res['Value']
Exemple #2
0
def test_ResourcesGetters():
    res = Resources.getSites()
    assert res["OK"] is True, res["Message"]
    assert res["Value"] == ["DIRAC.Jenkins.ch"], res["Value"]

    res = Resources.getSiteCEMapping()
    assert res["OK"] is True, res["Message"]
    assert res["Value"] == {
        "DIRAC.Jenkins.ch": ["jenkins.cern.ch"]
    }, res["Value"]

    res = Resources.getCESiteMapping()
    assert res["OK"] is True, res["Message"]
    assert res["Value"] == {
        "jenkins.cern.ch": "DIRAC.Jenkins.ch"
    }, res["Value"]

    res = Resources.getCESiteMapping("jenkins.cern.ch")
    assert res["OK"] is True, res["Message"]
    assert res["Value"] == {
        "jenkins.cern.ch": "DIRAC.Jenkins.ch"
    }, res["Value"]

    res = Resources.getCESiteMapping("not-here")
    assert res["OK"] is True, res["Message"]
    assert res["Value"] == {}, res["Value"]