Conversation
Codecov Report
@@ Coverage Diff @@
## master #270 +/- ##
==========================================
- Coverage 85.23% 85.22% -0.01%
==========================================
Files 24 24
Lines 1219 1225 +6
==========================================
+ Hits 1039 1044 +5
- Misses 180 181 +1
Continue to review full report at Codecov.
|
glennrfisher
approved these changes
Oct 4, 2017
| inited = watson_developer_cloud.AlchemyLanguageV1(url=default_url, api_key='boguskey', | ||
| x_watson_learning_opt_out=True) | ||
| assert inited.x_watson_learning_opt_out | ||
| #assert inited.x_watson_learning_opt_out |
Contributor
There was a problem hiding this comment.
Can delete this line, since it's no longer needed.
| assert message is not None | ||
| assert responses.calls[0].request.url == message_url1 | ||
| assert 'x-watson-learning-opt-out' in responses.calls[0].request.headers | ||
| assert responses.calls[0].request.headers['x-watson-learning-opt-out'] == 'true' |
Contributor
There was a problem hiding this comment.
Nice check on the response. More confidence-inspiring than the previous assert inited.x_watson_learning_opt_out.
germanattanasio
approved these changes
Oct 4, 2017
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.
This PR adds support for a
set_default_headersin the baseWatsonDeveloperCloudServiceclass. This is a more general and flexible solution for setting thex-watson-learning-opt-outheader. I left thex_watson_learning_opt_outparameter on the service constructor for backward compatibility -- we should consider removing that on the next major release.