Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compute engine system tests #54

Merged
merged 2 commits into from
Oct 25, 2016
Merged

Conversation

theacodes
Copy link
Contributor

Resolves #40

@theacodes theacodes added this to the 1.0.0 milestone Oct 25, 2016
@@ -71,7 +70,7 @@ def _retrieve_info(self, request):
service_account=self._service_account_email)

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants