Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add samples for Redis Labs redis for standard py37 #1628

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

Merged
merged 1 commit into from
Aug 16, 2018

Conversation

andrewsg
Copy link
Member

No description provided.

@andrewsg andrewsg requested a review from ace-n August 10, 2018 22:58
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 10, 2018
Copy link

@ace-n ace-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once nits are addressed.


# [START gae_py37_redis_client]
redis_host = os.environ.get('REDIS_HOST', 'localhost')
redis_port = int(os.environ.get('REDIS_PORT', 6379))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: will this fail [gracefully] if REDIS_PORT is set to a non-integer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: what is the format of r.data? Is there any chance of spurious 1s or 2s occurring in it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@andrewsg andrewsg merged commit 603bfc0 into GoogleCloudPlatform:master Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants