Skip to content

Make sure we normalize header types for test mock connection class#1111

Closed
Kami wants to merge 7 commits intoapache:trunkfrom
Kami:make_sure_hader_value_is_string
Closed

Make sure we normalize header types for test mock connection class#1111
Kami wants to merge 7 commits intoapache:trunkfrom
Kami:make_sure_hader_value_is_string

Conversation

@Kami
Copy link
Copy Markdown
Member

@Kami Kami commented Sep 19, 2017

This pull request fixes the issue reported in https://issues.apache.org/jira/browse/LIBCLOUD-945.

We normalized header types inside the actual Connection class, but not inside the Connection class used by the tests. That's why some of the tests failed with newer version of requests which doesn't automatically cast header values to strings anymore.

@@ -634,7 +634,7 @@ def _upload_in_chunks(self, response, data, iterator, object_path,
chunk_hash = base64.b64encode(b(chunk_hash.digest()))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changes in those files are not needed anymore because we now cast header values inside the base connection class, but they don't hurt either.

@Kami Kami changed the title [Common] Make sure we normalize header types for test mock connection class Make sure we normalize header types for test mock connection class Sep 19, 2017
@asfgit asfgit closed this in 28a5590 Sep 19, 2017
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #1111 into trunk will increase coverage by <.01%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk    #1111      +/-   ##
==========================================
+ Coverage   85.33%   85.33%   +<.01%     
==========================================
  Files         342      342              
  Lines       65695    65709      +14     
  Branches     5856     5855       -1     
==========================================
+ Hits        56060    56072      +12     
- Misses       7250     7252       +2     
  Partials     2385     2385
Impacted Files Coverage Δ
libcloud/http.py 89.31% <100%> (+0.16%) ⬆️
libcloud/test/__init__.py 86.32% <100%> (+0.23%) ⬆️
libcloud/storage/drivers/azure_blobs.py 66.97% <66.66%> (ø) ⬆️
libcloud/test/storage/test_azure_blobs.py 91.63% <81.81%> (-0.25%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59b44a0...eafbc11. Read the comment docs.


if blob_type == 'PageBlob':
headers['Content-Length'] = 0
headers['Content-Length'] = str('0')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just wondering, isn't '0' enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants