def __init__(self, name_prefix='', use_cache=False, sku='Standard', location=get_region_override('westus'), parameter_name=SERVICEBUS_NAMESPACE_PARAM, resource_group_parameter_name=RESOURCE_GROUP_PARAM, disable_recording=True, playback_fake_resource=None, client_kwargs=None, random_name_enabled=True): super(ServiceBusNamespacePreparer, self).__init__(name_prefix, 24, random_name_enabled=random_name_enabled, disable_recording=disable_recording, playback_fake_resource=playback_fake_resource, client_kwargs=client_kwargs) self.location = location self.sku = sku self.resource_group_parameter_name = resource_group_parameter_name self.parameter_name = parameter_name self.connection_string = '' if random_name_enabled: self.resource_moniker = self.name_prefix + "sbname" self.set_cache(use_cache, sku, location)
from azure.mgmt.resource import ResourceManagementClient from azure.mgmt.eventhub import EventHubManagementClient from azure.eventhub import EventHubProducerClient from uamqp import ReceiveClient from uamqp.authentication import SASTokenAuth from devtools_testutils import get_region_override collect_ignore = [] PARTITION_COUNT = 2 CONN_STR = "Endpoint=sb://{}/;SharedAccessKeyName={};SharedAccessKey={};EntityPath={}" RES_GROUP_PREFIX = "eh-res-group" NAMESPACE_PREFIX = "eh-ns" EVENTHUB_PREFIX = "eh" EVENTHUB_DEFAULT_AUTH_RULE_NAME = 'RootManageSharedAccessKey' LOCATION = get_region_override("westus") def pytest_addoption(parser): parser.addoption("--sleep", action="store", default="True", help="sleep on reconnect test: True or False") @pytest.fixture def sleep(request): sleep = request.config.getoption("--sleep") return sleep.lower() in ('true', 'yes', '1', 'y')