Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Conversation

@smithsz
Copy link
Contributor

@smithsz smithsz commented Aug 4, 2017

Thanks for your hard work, please ensure all items are complete before opening.

What

Implement Cloudant.bluemix() client class method.

Example Usage

import os
from cloudant.client import Cloudant

c = Cloudant.bluemix(os.getenv('VCAP_SERVICES'), 'Cloudant NoSQL DB')

Testing

Includes additional unit tests.

Issues

Fixes #313.

@smithsz smithsz force-pushed the 313-bluemix-client-constructor branch from e9eed27 to f51cf68 Compare August 7, 2017 14:28
variable.
"""
instance_name = 'Cloudant NoSQL DB-lv'
vcap_services = {'cloudantNoSQLDB': [{
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to test with a JSON object that has multiple Cloudant instances to verify that instance_name is working correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good thinking. I'll add an additional test. I'll also add a test for 1 service in VCAP without specifying instance_name.

tests/unit/cloud_foundry_tests.py is testing majority of this. But since I've already gaffed this once it'd be good to test again at the client instantiation level too.

@smithsz smithsz force-pushed the 313-bluemix-client-constructor branch 2 times, most recently from b58c661 to 8512b8d Compare August 8, 2017 10:19
Copy link
Member

@ricellis ricellis left a comment

Choose a reason for hiding this comment

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

+1 just the CHANGES comment needs a tweak I think.

CHANGES.rst Outdated
@@ -1,5 +1,6 @@
2.6.0 (Unreleased)
==================
- [NEW] Added ``Cloudant.bluemix()`` client class method for instantiating a Cloudant Bluemix client.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure a "Cloudant Bluemix client" is really a thing.
Instantiating a client from VCAP_SERVICES metadata?
Last time we went with:

  • [NEW] Added cloudant_bluemix method to the Cloudant client allowing service credentials to be passed using the CloudFoundry VCAP_SERVICES environment variable.

append_response_error_content,
InfiniteSession,
ClientSession)
ClientSession,
Copy link
Member

Choose a reason for hiding this comment

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

Copyright date on this file is a bit weird, but I think it's fixed in #306 anyway.

@ricellis ricellis modified the milestone: 2.6.0 Aug 8, 2017
Added `Cloudant.bluemix()` client class method for instantiating a Cloudant
Bluemix client.
@smithsz smithsz force-pushed the 313-bluemix-client-constructor branch from 8512b8d to 17d8c63 Compare August 8, 2017 15:39
@smithsz smithsz merged commit 74a2784 into master Aug 8, 2017
@smithsz smithsz deleted the 313-bluemix-client-constructor branch August 8, 2017 16:01
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.

3 participants