Skip to content
Merged

fixes #166

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions azure/storage/blob/blockblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from .._serialization import (
_get_request_body,
_get_request_body_bytes_only,
_add_metadata_headers,
)
from .._http import HTTPRequest
from ._upload_chunking import (
Expand Down Expand Up @@ -197,7 +198,7 @@ def _put_blob(self, container_name, blob_name, blob, content_settings=None,
('If-Match', _to_str(if_match)),
('If-None-Match', _to_str(if_none_match))
]
_metadata_to_headers(metadata, request)
_add_metadata_headers(metadata, request)
if content_settings is not None:
request.headers += content_settings._to_headers()
request.body = _get_request_body_bytes_only('blob', blob)
Expand Down Expand Up @@ -344,7 +345,7 @@ def put_block_list(
('If-Match', _to_str(if_match)),
('If-None-Match', _to_str(if_none_match)),
]
_metadata_to_headers(metadata, request)
_add_metadata_headers(metadata, request)
if content_settings is not None:
request.headers += content_settings._to_headers()
request.body = _get_request_body(
Expand Down
3 changes: 2 additions & 1 deletion azure/storage/blob/pageblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
)
from .._serialization import (
_get_request_body_bytes_only,
_add_metadata_headers,
)
from .._http import HTTPRequest
from ._error import (
Expand Down Expand Up @@ -200,7 +201,7 @@ def create_blob(
('If-Match', _to_str(if_match)),
('If-None-Match', _to_str(if_none_match))
]
_metadata_to_headers(metadata, request)
_add_metadata_headers(metadata, request)
if content_settings is not None:
request.headers += content_settings._to_headers()

Expand Down
15 changes: 0 additions & 15 deletions tests/test_common_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,21 +304,6 @@ def test_get_blob_with_range(self):
self.assertIsInstance(blob, Blob)
self.assertEqual(blob.content, self.byte_data[:6])

@record
def test_get_blob_with_range_and_get_content_md5(self):
# Arrange
blob_name = self._create_block_blob()

# Act
blob = self.bs.get_blob_to_bytes(self.container_name, blob_name,
start_range=0, end_range=5,
range_get_content_md5=True)

# Assert
self.assertIsInstance(blob, Blob)
self.assertEqual(blob.content, self.byte_data[:6])
self.assertIsNotNone(blob.properties.content_settings.content_md5)

@record
def test_get_blob_with_lease(self):
# Arrange
Expand Down