Skip to content

Setting up test infrastructure #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 22, 2020
Merged
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
1 change: 1 addition & 0 deletions sdk/Table/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
1 change: 1 addition & 0 deletions sdk/Table/azure/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Empty file.
41 changes: 41 additions & 0 deletions sdk/Table/azure/storage/tables/_deserialize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=unused-argument

from azure.core.exceptions import ResourceExistsError

from ._shared.models import StorageErrorCode
from ._models import QueueProperties


def deserialize_metadata(response, obj, headers):
raw_metadata = {k: v for k, v in response.headers.items() if k.startswith("x-ms-meta-")}
return {k[10:]: v for k, v in raw_metadata.items()}


def deserialize_queue_properties(response, obj, headers):
metadata = deserialize_metadata(response, obj, headers)
queue_properties = QueueProperties(
metadata=metadata,
**headers
)
return queue_properties


def deserialize_queue_creation(response, obj, headers):
if response.status_code == 204:
error_code = StorageErrorCode.queue_already_exists
error = ResourceExistsError(
message="Queue already exists\nRequestId:{}\nTime:{}\nErrorCode:{}".format(
headers['x-ms-request-id'],
headers['Date'],
error_code
),
response=response)
error.error_code = error_code
error.additional_info = {}
raise error
return headers
14 changes: 14 additions & 0 deletions sdk/Table/azure/storage/tables/_generated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._azure_table import AzureTable
__all__ = ['AzureTable']

try:
from ._patch import patch_sdk
patch_sdk()
except ImportError:
pass
64 changes: 64 additions & 0 deletions sdk/Table/azure/storage/tables/_generated/_azure_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.core import PipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from ._configuration import AzureTableConfiguration
from .operations import TableOperations
from .operations import ServiceOperations
from . import models


class AzureTable(object):
"""AzureTable.

:ivar table: TableOperations operations
:vartype table: azure_table.operations.TableOperations
:ivar service: ServiceOperations operations
:vartype service: azure_table.operations.ServiceOperations
:param url: The URL of the service account or table that is the targe of the desired operation.
:type url: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

def __init__(
self,
url, # type: str
**kwargs # type: Any
):
# type: (...) -> None
base_url = '{url}'
self._config = AzureTableConfiguration(url, **kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.table = TableOperations(
self._client, self._config, self._serialize, self._deserialize)
self.service = ServiceOperations(
self._client, self._config, self._serialize, self._deserialize)

def close(self):
# type: () -> None
self._client.close()

def __enter__(self):
# type: () -> AzureTable
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
self._client.__exit__(*exc_details)
55 changes: 55 additions & 0 deletions sdk/Table/azure/storage/tables/_generated/_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

VERSION = "unknown"

class AzureTableConfiguration(Configuration):
"""Configuration for AzureTable.

Note that all parameters used to create this instance are saved as instance
attributes.

:param url: The URL of the service account or table that is the targe of the desired operation.
:type url: str
"""

def __init__(
self,
url, # type: str
**kwargs # type: Any
):
# type: (...) -> None
if url is None:
raise ValueError("Parameter 'url' must not be None.")
super(AzureTableConfiguration, self).__init__(**kwargs)

self.url = url
self.version = "2019-02-02"
kwargs.setdefault('sdk_moniker', 'azuretable/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
8 changes: 8 additions & 0 deletions sdk/Table/azure/storage/tables/_generated/aio/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._azure_table_async import AzureTable
__all__ = ['AzureTable']
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any

from azure.core import AsyncPipelineClient
from msrest import Deserializer, Serializer

from ._configuration_async import AzureTableConfiguration
from .operations_async import TableOperations
from .operations_async import ServiceOperations
from .. import models


class AzureTable(object):
"""AzureTable.

:ivar table: TableOperations operations
:vartype table: azure_table.aio.operations_async.TableOperations
:ivar service: ServiceOperations operations
:vartype service: azure_table.aio.operations_async.ServiceOperations
:param url: The URL of the service account or table that is the targe of the desired operation.
:type url: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

def __init__(
self,
url: str,
**kwargs: Any
) -> None:
base_url = '{url}'
self._config = AzureTableConfiguration(url, **kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.table = TableOperations(
self._client, self._config, self._serialize, self._deserialize)
self.service = ServiceOperations(
self._client, self._config, self._serialize, self._deserialize)

async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "AzureTable":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
await self._client.__aexit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any

from azure.core.configuration import Configuration
from azure.core.pipeline import policies

VERSION = "unknown"

class AzureTableConfiguration(Configuration):
"""Configuration for AzureTable.

Note that all parameters used to create this instance are saved as instance
attributes.

:param url: The URL of the service account or table that is the targe of the desired operation.
:type url: str
"""

def __init__(
self,
url: str,
**kwargs: Any
) -> None:
if url is None:
raise ValueError("Parameter 'url' must not be None.")
super(AzureTableConfiguration, self).__init__(**kwargs)

self.url = url
self.version = "2019-02-02"
kwargs.setdefault('sdk_moniker', 'azuretable/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs: Any
) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._table_operations_async import TableOperations
from ._service_operations_async import ServiceOperations

__all__ = [
'TableOperations',
'ServiceOperations',
]
Loading