Esempio n. 1
0
def test_is_valid(fake_shell):
    req = DiracProxy(group='some_group')
    v = DiracProxyInfo(req)

    assert v.is_valid()

    fake_shell.timeleft = 0

    assert not v.is_valid()
Esempio n. 2
0
def test_is_valid(fake_shell):
    req = DiracProxy(group='some_group')
    v = DiracProxyInfo(req)

    assert v.is_valid()

    fake_shell.timeleft = 0

    assert not v.is_valid()
Esempio n. 3
0
def test_create(fake_shell):
    req = DiracProxy(group='some_group')
    v = DiracProxyInfo(req)
    v.create()

    assert v.shell.check_call.call_count == 1
    cmd = v.shell.check_call.call_args[0][0]
    assert 'dirac-proxy-init' in cmd
    assert '-group some_group' in cmd
    assert '-out "{0}"'.format(v.location) in cmd
Esempio n. 4
0
def test_create(fake_shell):
    req = DiracProxy(group='some_group')
    v = DiracProxyInfo(req)
    v.create()

    assert v.shell.check_call.call_count == 1
    cmd = v.shell.check_call.call_args[0][0]
    assert 'dirac-proxy-init' in cmd
    assert '-group some_group' in cmd
    assert '-out "{0}"'.format(v.location) in cmd
Esempio n. 5
0
 def diracLFNBase():
     """
     Compute a sensible default LFN base name
     If ``DiracLFNBase`` has been defined, use that.
     Otherwise, construct one from the user name and the user VO
     """
     if configDirac['DiracLFNBase']:
         return configDirac['DiracLFNBase']
     return '/{0}/user/{1}/{2}'.format(configDirac['userVO'], DiracProxyInfo(DiracProxy()).username[0], DiracProxyInfo(DiracProxy()).username)
Esempio n. 6
0
 def diracLFNBase(credential_requirements):
     """
     Compute a sensible default LFN base name
     If ``DiracLFNBase`` has been defined, use that.
     Otherwise, construct one from the user name and the user VO
     """
     if configDirac['DiracLFNBase']:
         return configDirac['DiracLFNBase']
     user = DiracProxyInfo(credential_requirements).username
     return '/{0}/user/{1}/{2}'.format(configDirac['userVO'], user[0], user)
Esempio n. 7
0
def test_location(fake_shell):
    req = DiracProxy(group='some_group')
    v = DiracProxyInfo(req)
    assert v.location == v.default_location()
Esempio n. 8
0
def test_default_location(fake_shell):
    v = DiracProxyInfo(DiracProxy())
    assert v.location == v.default_location()
Esempio n. 9
0
def test_construct(fake_shell):
    req = DiracProxy(group='some_group')
    DiracProxyInfo(req)
Esempio n. 10
0
def test_plain_construct(fake_shell):
    DiracProxyInfo(DiracProxy())
Esempio n. 11
0
def test_location(fake_shell):
    req = DiracProxy(group='some_group')
    v = DiracProxyInfo(req)
    assert v.location == v.default_location()
Esempio n. 12
0
def test_default_location(fake_shell):
    v = DiracProxyInfo(DiracProxy())
    assert v.location == v.default_location()