def test_anonymous_credentials_ctor():
    anon = credentials.AnonymousCredentials()

    assert anon.token is None
    assert anon.expiry is None
    assert not anon.expired
    assert anon.valid
def test_anonymous_credentials_apply_default():
    anon = credentials.AnonymousCredentials()
    headers = {}
    anon.apply(headers)
    assert headers == {}
    with pytest.raises(ValueError):
        anon.apply(headers, token="TOKEN")
def test_anonymous_credentials_before_request():
    anon = credentials.AnonymousCredentials()
    request = object()
    method = "GET"
    url = "https://example.com/api/endpoint"
    headers = {}
    anon.before_request(request, method, url, headers)
    assert headers == {}
def test_anonymous_credentials_refresh():
    anon = credentials.AnonymousCredentials()

    request = object()
    with pytest.raises(ValueError):
        anon.refresh(request)