Skip to content
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

[SchemaRegistry] migrate to test proxy #23438

Merged
12 commits merged into from
Mar 11, 2022

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
from ._version import VERSION
from ._version import VERSION # pylint: disable=import-error

__version__ = VERSION

from ._schema_registry_avro_encoder import AvroEncoder
from ._message_protocol import MessageType, MessageContent
from ._schema_registry_avro_encoder import AvroEncoder # pylint: disable=import-error
from ._message_protocol import MessageType, MessageContent # pylint: disable=import-error


__all__ = [
"AvroEncoder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import avro
from avro.io import DatumWriter, DatumReader, BinaryDecoder, BinaryEncoder

from ._abstract_avro_encoder import AbstractAvroObjectEncoder
from ._abstract_avro_encoder import AbstractAvroObjectEncoder # pylint: disable=import-error

ObjectType = TypeVar("ObjectType")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
from io import BytesIO
from typing import Any, Dict, Mapping, Optional, Union, Callable

from .exceptions import (
from .exceptions import ( # pylint: disable=import-error
SchemaParseError,
SchemaEncodeError,
SchemaDecodeError,
)
from ._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder
from ._message_protocol import MessageContent, MessageType
from ._constants import (
from ._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder # pylint: disable=import-error
from ._message_protocol import MessageContent, MessageType # pylint: disable=import-error
from ._constants import ( # pylint: disable=import-error
SCHEMA_ID_START_INDEX,
SCHEMA_ID_LENGTH,
CONTENT_START_INDEX,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
from ._schema_registry_avro_encoder_async import AvroEncoder
from ._schema_registry_avro_encoder_async import AvroEncoder # pylint: disable=import-error

__all__ = [
"AvroEncoder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
import logging
from io import BytesIO
from typing import Any, Callable, Dict, Mapping, Union, Optional
from ._async_lru import alru_cache
from .._constants import (
from ._async_lru import alru_cache # pylint: disable=import-error
from .._constants import ( # pylint: disable=import-error
SCHEMA_ID_START_INDEX,
SCHEMA_ID_LENGTH,
CONTENT_START_INDEX,
AVRO_MIME_TYPE,
RECORD_FORMAT_IDENTIFIER_LENGTH,
)
from .._message_protocol import MessageType, MessageContent
from .._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder
from ..exceptions import (
from .._message_protocol import MessageType, MessageContent # pylint: disable=import-error
from .._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder # pylint: disable=import-error
from ..exceptions import ( # pylint: disable=import-error
SchemaParseError,
SchemaEncodeError,
SchemaDecodeError,
Expand Down
13 changes: 13 additions & 0 deletions sdk/schemaregistry/azure-schemaregistry-avroencoder/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest
from devtools_testutils import add_general_regex_sanitizer, test_proxy, add_oauth_response_sanitizer

# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
add_general_regex_sanitizer(regex="(?<=\\/\\/)[a-z-]+(?=\\.servicebus\\.windows\\.net)", value="fake_resource")
add_oauth_response_sanitizer()

# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
@pytest.fixture(scope="session", autouse=True)
def start_proxy(test_proxy):
return
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
],
python_requires=">=3.6",
zip_safe=False,
packages=find_packages(exclude=exclude_packages),
packages=[
'azure.schemaregistry.encoder.avroencoder',
'azure.schemaregistry.encoder.avroencoder.aio',
],
install_requires=install_packages
)
Loading