Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Add compute engine system tests#54

Merged
theacodes merged 2 commits intomasterfrom
compute-engine-system-tests
Oct 25, 2016
Merged

Add compute engine system tests#54
theacodes merged 2 commits intomasterfrom
compute-engine-system-tests

Conversation

@theacodes
Copy link
Contributor

Resolves #40

@theacodes theacodes added this to the 1.0.0 milestone Oct 25, 2016

self._service_account_email = info['email']
self._scopes = _helpers.string_to_scopes(info['scopes'])
self._scopes = info['scopes']

This comment was marked as spam.

This comment was marked as spam.

from google.auth import _helpers
from google.auth import compute_engine
from google.auth.compute_engine import _metadata
import pytest

This comment was marked as spam.

This comment was marked as spam.

if not _metadata.ping(request):
pytest.skip('Compute Engine metadata service is not available.')


This comment was marked as spam.

This comment was marked as spam.

pytest.skip('Compute Engine metadata service is not available.')


def test_refresh(request, token_info):

This comment was marked as spam.

This comment was marked as spam.

credentials.refresh(request)

assert credentials.token is not None
assert credentials._service_account_email is not None

This comment was marked as spam.

This comment was marked as spam.

assert credentials._service_account_email is not None

info = token_info(credentials.token)
info_scopes = _helpers.string_to_scopes(info['scope'])

This comment was marked as spam.

assert info['scope'] == (
'https://www.googleapis.com/auth/userinfo.email '
'https://www.googleapis.com/auth/userinfo.profile')
info_scopes = _helpers.string_to_scopes(info['scope'])

This comment was marked as spam.

@dhermes dhermes mentioned this pull request Oct 25, 2016
@dhermes
Copy link
Contributor

dhermes commented Oct 25, 2016

LGTM (in light of the existence of #55).

Also, don't block here, but as a general rule I try to have system tests only rely on public attributes. Why isn't it valuable for the svc. acct. email to be public?

@theacodes
Copy link
Contributor Author

Why isn't it valuable for the svc. acct. email to be public?

It could be useful, but I want to err on the side of being limited in our public interface.

@theacodes theacodes merged commit f7b9279 into master Oct 25, 2016
@theacodes theacodes deleted the compute-engine-system-tests branch October 25, 2016 21:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants