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()
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
def test_location(fake_shell):
    req = VomsProxy(vo='some_vo')
    v = VomsProxyInfo(req)
    assert v.location == v.default_location() + ':' + 'some_vo'
def test_default_location(fake_shell):
    v = VomsProxyInfo(VomsProxy())
    assert v.location == v.default_location()
def test_construct(fake_shell):
    req = VomsProxy(vo='some_vo')
    VomsProxyInfo(req)
def test_plain_construct(fake_shell):
    VomsProxyInfo(VomsProxy())
    AfsTokenInfo(AfsToken())