Skip to content

Commit

Permalink
Refactored shared code and added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
annatisch committed Jun 22, 2019
1 parent 8f39788 commit 9c4b0cd
Show file tree
Hide file tree
Showing 120 changed files with 37,629 additions and 1,604 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,6 @@ src/build
# [begoldsm] ignore virtual env if it exists.
adlEnv/

code_reports
code_reports
sdk/storage/azure-storage-blob/tests/settings_real.py
sdk/storage/azure-storage-queue/tests/settings_real.py
63 changes: 63 additions & 0 deletions sdk/storage/azure-storage-queue/azure/storage/queue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,66 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

from .version import __version__
from .queue_client import QueueClient
from .queue_service_client import QueueServiceClient
from ._shared.policies import ExponentialRetry, LinearRetry, NoRetry
from ._shared.models import(
LocationMode,
ResourceTypes,
AccountPermissions,
StorageErrorCode
)
from ._queue_utils import (
MessageIterator,
TextBase64EncodePolicy,
TextBase64DecodePolicy,
BinaryBase64EncodePolicy,
BinaryBase64DecodePolicy,
TextXMLEncodePolicy,
TextXMLDecodePolicy,
NoEncodePolicy,
NoDecodePolicy
)
from .models import (
QueueMessage,
QueueProperties,
QueuePropertiesPaged,
QueuePermissions,
AccessPolicy,
Logging,
Metrics,
CorsRule,
RetentionPolicy,
)

__all__ = [
'QueueClient',
'QueueServiceClient',
'ExponentialRetry',
'LinearRetry',
'NoRetry',
'LocationMode',
'ResourceTypes',
'AccountPermissions',
'StorageErrorCode',
'QueueMessage',
'QueueProperties',
'QueuePropertiesPaged',
'QueuePermissions',
'AccessPolicy',
'TextBase64EncodePolicy',
'TextBase64DecodePolicy',
'BinaryBase64EncodePolicy',
'BinaryBase64DecodePolicy',
'TextXMLEncodePolicy',
'TextXMLDecodePolicy',
'NoEncodePolicy',
'NoDecodePolicy',
'MessageIterator',
'Logging',
'Metrics',
'CorsRule',
'RetentionPolicy',
]

This file was deleted.

68 changes: 0 additions & 68 deletions sdk/storage/azure-storage-queue/azure/storage/queue/_error.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from ._configuration import AzureQueueStorageConfiguration
from ._azure_queue_storage import AzureQueueStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from azure.core import PipelineClient
from msrest import Serializer, Deserializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from azure.core.configuration import Configuration, ConnectionConfiguration
from azure.core.pipeline import policies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from ._azure_queue_storage_async import AzureQueueStorage
from ._configuration_async import AzureQueueStorageConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from azure.core import AsyncPipelineClient
from msrest import Serializer, Deserializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from azure.core.configuration import Configuration, ConnectionConfiguration
from azure.core.pipeline import policies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from ._service_operations_async import ServiceOperations
from ._queue_operations_async import QueueOperations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from azure.core.exceptions import map_error

Expand Down Expand Up @@ -91,7 +92,10 @@ async def update(self, queue_message, pop_receipt, visibilitytimeout, timeout=No
header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str')

# Construct body
body_content = self._serialize.body(queue_message, 'QueueMessage')
if queue_message is not None:
body_content = self._serialize.body(queue_message, 'QueueMessage')
else:
body_content = None

# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from azure.core.exceptions import map_error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from azure.core.exceptions import map_error

Expand Down Expand Up @@ -402,8 +403,10 @@ async def set_access_policy(self, queue_acl=None, timeout=None, request_id=None,
header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str')

# Construct body
serialization_ctxt = {'xml': {'name': 'SignedIdentifiers', 'itemsName': 'SignedIdentifier', 'wrapped': True}}
if queue_acl is not None:
body_content = self._serialize.body(queue_acl, '[SignedIdentifier]')
body_content = self._serialize.serialize_iter(queue_acl, 'SignedIdentifier',
serialization_ctxt=serialization_ctxt)
else:
body_content = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from azure.core.exceptions import map_error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

try:
from ._models_py3 import AccessPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: skip-file

from enum import Enum

Expand Down
Loading

0 comments on commit 9c4b0cd

Please sign in to comment.