Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ interactions:
Connection: [keep-alive]
Content-Length: ['44']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.17
msrest_azure/0.4.15 servicebusmanagementclient/0.3.0 Azure-SDK-For-Python]
User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27
msrest_azure/0.4.25 azure-mgmt-servicebus/0.5.0 Azure-SDK-For-Python]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/CheckNameAvailability?api-version=2017-04-01
Expand All @@ -18,14 +18,15 @@ interactions:
cache-control: [no-cache]
content-length: ['53']
content-type: [application/json; charset=utf-8]
date: ['Wed, 01 Nov 2017 01:28:18 GMT']
date: ['Sat, 21 Apr 2018 00:30:31 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
server-sb: [Service-Bus-Resource-Provider/SN1]
server: [Service-Bus-Resource-Provider/CH3, Microsoft-HTTPAPI/2.0]
server-sb: [Service-Bus-Resource-Provider/CH3]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-ms-ratelimit-remaining-subscription-writes: ['1196']
x-content-type-options: [nosniff]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
version: 1

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def test_sb_namespace_curd(self, resource_group, location):
# Create a Namespace
namespace_name = "testingpythontestcasenamespace"

namespaceparameter=SBNamespace(location,{'tag1':'value1','tag2':'value2'},SBSku(SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter,None,True).output
self.assertEqual(creatednamespace.name,namespace_name)
namespaceparameter=SBNamespace(location=location,tags={'tag1':'value1','tag2':'value2'},sku=SBSku(name=SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter).result()
self.assertEqual(creatednamespace.name, namespace_name)
#
# # Get created Namespace
#
Expand All @@ -42,7 +42,7 @@ def test_sb_namespace_curd(self, resource_group, location):

# Get the List of Namespaces under the resourceGroup - list_by_resource_group

listbyresourcegroupresponse = list(self.servicebus_client.namespaces.list_by_resource_group(resource_group_name,False,False))
listbyresourcegroupresponse = list(self.servicebus_client.namespaces.list_by_resource_group(resource_group_name))
self.assertGreater(len(listbyresourcegroupresponse),0,"No Namespace returned, List is empty")
self.assertEqual(listbyresourcegroupresponse[0].name,namespace_name,"Created namespace not found - ListByResourgroup")

Expand Down Expand Up @@ -98,7 +98,7 @@ def test_sb_namespace_curd(self, resource_group, location):
self.assertEqual(createnamespaceauthorule[0].name, defaultauthorule_name)

# Delete the create namespace
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name,None,True).output
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name).result()

#------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down
10 changes: 5 additions & 5 deletions azure-mgmt-servicebus/tests/test_azure_mgmt_servicebus_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def test_sb_queue_curd(self, resource_group, location):
# Create a Namespace
namespace_name = "testingpythontestcasequeue"

namespaceparameter = SBNamespace(location, {'tag1': 'value1', 'tag2': 'value2'}, SBSku(SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter,None,True).output
namespaceparameter = SBNamespace(location=location, tags={'tag1': 'value1', 'tag2': 'value2'}, sku=SBSku(name=SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter).result()
self.assertEqual(creatednamespace.name, namespace_name)

while (self.servicebus_client.namespaces.get(resource_group_name, namespace_name).provisioning_state != 'Succeeded'):
Expand All @@ -56,7 +56,7 @@ def test_sb_queue_curd(self, resource_group, location):
self.assertEqual(listbynamespacequeueresponse[0].name, queue_name)

# update queue
updatequeueresponse = self.servicebus_client.queues.create_or_update(resource_group_name, namespace_name, queue_name, SBQueue( enable_express=True, max_delivery_count=5, max_size_in_megabytes=1024 ))
updatequeueresponse = self.servicebus_client.queues.create_or_update(resource_group_name, namespace_name, queue_name, SBQueue(enable_express=True, max_delivery_count=5, max_size_in_megabytes=1024 ))
self.assertEqual(updatequeueresponse.name, queue_name)
self.assertEqual(updatequeueresponse.max_delivery_count, 5)
self.assertEqual(updatequeueresponse.max_size_in_megabytes, 1024)
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_sb_queue_curd(self, resource_group, location):

# regenerate Keys for authorizationrule - Primary
regenrateSecondarykeyauthorizationrule = self.servicebus_client.queues.regenerate_keys(resource_group_name,namespace_name, queue_name, authoRule_name,'SecondaryKey')
self.assertNotEqual(listkeysauthorizationrule.secondary_key,regenrateSecondarykeyauthorizationrule.secondary_key)
self.assertNotEqual(listkeysauthorizationrule.secondary_key, regenrateSecondarykeyauthorizationrule.secondary_key)

# delete the authorizationrule
self.servicebus_client.queues.delete_authorization_rule(resource_group_name, namespace_name, queue_name, authoRule_name)
Expand All @@ -106,7 +106,7 @@ def test_sb_queue_curd(self, resource_group, location):
self.servicebus_client.queues.delete(resource_group_name, namespace_name, queue_name)

# Delete the create namespace
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name,None,True).output
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name).result()

#------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def test_sb_topic_curd(self, resource_group, location):
# Create a Namespace
namespace_name = "testingpythontestcasetopic"

namespaceparameter = SBNamespace(location, {'tag1': 'value1', 'tag2': 'value2'}, SBSku(SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter,None,True).output
namespaceparameter = SBNamespace(location=location, tags={'tag1': 'value1', 'tag2': 'value2'}, sku=SBSku(name=SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter).result()
self.assertEqual(creatednamespace.name, namespace_name)

while (self.servicebus_client.namespaces.get(resource_group_name, namespace_name).provisioning_state != 'Succeeded'):
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_sb_topic_curd(self, resource_group, location):
self.servicebus_client.topics.delete(resource_group_name, namespace_name, topic_name)

# Delete the create namespace
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name,None,True).output
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name).result()

#------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def test_sb_subscription_curd(self, resource_group, location):
# Create a Namespace
namespace_name = "testingpythontestcasesubscription"

namespaceparameter = SBNamespace(location, {'tag1': 'value1', 'tag2': 'value2'}, SBSku(SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter,None,True).output
namespaceparameter = SBNamespace(location=location, tags={'tag1': 'value1', 'tag2': 'value2'}, sku=SBSku(name=SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter).result()
self.assertEqual(creatednamespace.name, namespace_name)

while (self.servicebus_client.namespaces.get(resource_group_name, namespace_name).provisioning_state != 'Succeeded'):
Expand Down Expand Up @@ -75,7 +75,7 @@ def test_sb_subscription_curd(self, resource_group, location):
self.servicebus_client.topics.delete(resource_group_name, namespace_name, topic_name)

# Delete the create namespace
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name,None,True).output
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name).result()

#------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def test_sb_rule_curd(self, resource_group, location):
# Create a Namespace
namespace_name = "testingpythontestcaserule"

namespaceparameter = SBNamespace(location, {'tag1': 'value1', 'tag2': 'value2'}, SBSku(SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter,None,True).output
namespaceparameter = SBNamespace(location=location, tags={'tag1': 'value1', 'tag2': 'value2'}, sku=SBSku(name=SkuName.standard))
creatednamespace = self.servicebus_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter).result()
self.assertEqual(creatednamespace.name, namespace_name)

while (self.servicebus_client.namespaces.get(resource_group_name, namespace_name).provisioning_state != 'Succeeded'):
Expand All @@ -43,25 +43,25 @@ def test_sb_rule_curd(self, resource_group, location):

# Create a Topic
topic_name = "testingpythonsdktopic"
createtopicresponse = self.servicebus_client.topics.create_or_update(resource_group_name, namespace_name,topic_name,SBTopic())
createtopicresponse = self.servicebus_client.topics.create_or_update(resource_group_name, namespace_name, topic_name, SBTopic())
self.assertEqual(createtopicresponse.name, topic_name)

# Get the created Topic
gettopicresponse = self.servicebus_client.topics.get(resource_group_name, namespace_name,topic_name)
gettopicresponse = self.servicebus_client.topics.get(resource_group_name, namespace_name, topic_name)
self.assertEqual(gettopicresponse.name, topic_name)

# Create subscription
subscription_name = "testingpythonsdksubscription"
createsubscriptionresponse =self.servicebus_client.subscriptions.create_or_update(resource_group_name, namespace_name,topic_name,subscription_name,SBSubscription())
createsubscriptionresponse =self.servicebus_client.subscriptions.create_or_update(resource_group_name, namespace_name, topic_name, subscription_name, SBSubscription())
self.assertEqual(createsubscriptionresponse.name, subscription_name)

# Get created subscription
getsubscriptionresponse = self.servicebus_client.subscriptions.get(resource_group_name,namespace_name, topic_name,subscription_name)
getsubscriptionresponse = self.servicebus_client.subscriptions.get(resource_group_name, namespace_name, topic_name,subscription_name)
self.assertEqual(getsubscriptionresponse.name, subscription_name)

# create rule
rule_name = "testingpythonsdkrule"
createruleresponse = self.servicebus_client.rules.create_or_update(resource_group_name,namespace_name, topic_name,subscription_name,rule_name,Rule())
createruleresponse = self.servicebus_client.rules.create_or_update(resource_group_name, namespace_name, topic_name, subscription_name, rule_name, Rule())
self.assertEqual(createruleresponse.name, rule_name)

# get create rule
Expand All @@ -74,8 +74,8 @@ def test_sb_rule_curd(self, resource_group, location):

# update create rule with filter and action
strSqlExp = "myproperty='test'"
ruleparameter = Rule(None,FilterType.sql_filter,SqlFilter(sql_expression=strSqlExp),None)
createruleresponse = self.servicebus_client.rules.create_or_update(resource_group_name, namespace_name,topic_name, subscription_name, rule_name,ruleparameter)
ruleparameter = Rule(action=None, filter_type=FilterType.sql_filter, sql_filter=SqlFilter(sql_expression=strSqlExp), correlation_filter=None)
createruleresponse = self.servicebus_client.rules.create_or_update(resource_group_name, namespace_name, topic_name, subscription_name, rule_name, ruleparameter)
self.assertEqual(createruleresponse.name, rule_name)

# Delete the created subscription
Expand All @@ -85,7 +85,7 @@ def test_sb_rule_curd(self, resource_group, location):
self.servicebus_client.topics.delete(resource_group_name, namespace_name, topic_name)

# Delete the create namespace
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name,None,True).output
deletenamespace = self.servicebus_client.namespaces.delete(resource_group_name, namespace_name).result()

#------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down