Add samples for Redis Labs redis for standard py37#1628
Merged
andrewsg merged 1 commit intoGoogleCloudPlatform:masterfrom Aug 16, 2018
Merged
Add samples for Redis Labs redis for standard py37#1628andrewsg merged 1 commit intoGoogleCloudPlatform:masterfrom
andrewsg merged 1 commit intoGoogleCloudPlatform:masterfrom
Conversation
ace-n
approved these changes
Aug 15, 2018
|
|
||
| # [START gae_py37_redis_client] | ||
| redis_host = os.environ.get('REDIS_HOST', 'localhost') | ||
| redis_port = int(os.environ.get('REDIS_PORT', 6379)) |
There was a problem hiding this comment.
Nit: will this fail [gracefully] if REDIS_PORT is set to a non-integer?
Member
Author
There was a problem hiding this comment.
It'll fail with an exception that shows pretty clearly what the problem is, which is the best we can ask for given there is no way to operate without that number.
|
|
||
| r = client.get('/') | ||
| assert r.status_code == 200 | ||
| assert '1' in r.data.decode('utf-8') |
There was a problem hiding this comment.
Nit: what is the format of r.data? Is there any chance of spurious 1s or 2s occurring in it?
Member
Author
There was a problem hiding this comment.
No, this test is copied from Flex and we didn't have any issues. The format is an integer but it'll be starting from zero every time, and the feature that determines that is not a component under test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.