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

Add App Engine system tests#59

Merged
theacodes merged 3 commits intomasterfrom
gae-system-tests
Oct 27, 2016
Merged

Add App Engine system tests#59
theacodes merged 3 commits intomasterfrom
gae-system-tests

Conversation

@theacodes
Copy link
Copy Markdown
Contributor

@theacodes theacodes commented Oct 26, 2016

Has #58 as a diffbase.

Resolves #41, progress towards #55.

@theacodes theacodes added this to the 1.0.0 milestone Oct 26, 2016
@@ -0,0 +1 @@
lib

This comment was marked as spam.



# Patch os.path.expanduser. This should be fixed in GAE
# versions released after Nov 2016.

This comment was marked as spam.

This comment was marked as spam.

import contextlib
import json
import sys
from StringIO import StringIO

This comment was marked as spam.

This comment was marked as spam.

response = HTTP_REQUEST(url=url, method='GET')
token_info = json.loads(response.data.decode('utf-8'))

assert token_info['scope'] == EMAIL_SCOPE

This comment was marked as spam.

This comment was marked as spam.


# Get token info and verify scope
url = _helpers.update_query(TOKEN_INFO_URL, {
'access_token': scoped_credentials.token

This comment was marked as spam.

This comment was marked as spam.

@@ -0,0 +1,3 @@
urllib3
# Relative path to google-auth-python's source.
../../..

This comment was marked as spam.

This comment was marked as spam.

def vendor_app_dependencies():
"""Vendors in the test application's third-party dependencies."""
subprocess.check_call(
['pip', 'install', '-t', 'lib', '-r', 'requirements.txt'])

This comment was marked as spam.

This comment was marked as spam.

def deploy_app():
"""Deploys the test application using gcloud."""
subprocess.check_call(
['gcloud', 'app', 'deploy', '-q', 'app.yaml'])

This comment was marked as spam.

This comment was marked as spam.



@pytest.mark.skipif(
'SKIP_APP_ENGINE_SYSTEM_TEST' in os.environ,

This comment was marked as spam.

This comment was marked as spam.

reason='Explicitly skipping App Engine system tests.')
def test_live_application(app, http_request):
response = http_request(method='GET', url=app)
assert response.status == 200, response.data.decode('utf-8')

This comment was marked as spam.

This comment was marked as spam.

output = (
'Test {} failed: {}\n\n'
'Stacktrace:\n{}\n\n'
'Captured output:\n{}').format(

This comment was marked as spam.

This comment was marked as spam.

output += 'Captured output:\n{}'.format(capsys.getvalue())
tests = (test_credentials, test_default)

for test in tests:

This comment was marked as spam.

This comment was marked as spam.

@theacodes theacodes merged commit 7a27f47 into master Oct 27, 2016
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