-
Notifications
You must be signed in to change notification settings - Fork 309
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
Conversation
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
This comment was marked as spam.
Sorry, something went wrong.
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.
This comment was marked as spam.
Sorry, something went wrong.
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? |
It could be useful, but I want to err on the side of being limited in our public interface. |
Resolves #40