Example #1
0
def test_is_valid(fake_shell):
    req = VomsProxy(vo='some_vo')
    v = VomsProxyInfo(req)

    assert v.is_valid()

    fake_shell.timeleft = 0

    assert not v.is_valid()
Example #2
0
def test_create(fake_shell):
    req = VomsProxy(vo='some_vo')
    v = VomsProxyInfo(req)
    v.create()

    assert v.shell.check_call.call_count == 1
    cmd = v.shell.check_call.call_args[0][0]
    assert 'voms-proxy-init' in cmd
    assert '-voms some_vo' in cmd
    assert '-out "{0}"'.format(v.location) in cmd
Example #3
0
def test_location(fake_shell):
    req = VomsProxy(vo='some_vo')
    v = VomsProxyInfo(req)
    assert v.location == v.default_location() + ':' + 'some_vo'
Example #4
0
def test_default_location(fake_shell):
    v = VomsProxyInfo(VomsProxy())
    assert v.location == v.default_location()
Example #5
0
def test_construct(fake_shell):
    req = VomsProxy(vo='some_vo')
    VomsProxyInfo(req)
Example #6
0
def test_plain_construct(fake_shell):
    VomsProxyInfo(VomsProxy())
    AfsTokenInfo(AfsToken())