forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable TransportType.AmqpOverWebsocket for ServiceBus (Azure#10012)
* Enable TransportType.AmqpOverWebsocket for ServiceBus #4250 * Enables passing TransportType enum directly to constructors with use TransportType.Amqp as default, as well as parsing TransportType out of connection strings. * Adds sync and async tests for transport_type parsing. Co-authored-by: Kieran Brantner-Magee <[email protected]>
- Loading branch information
1 parent
ef48277
commit 9c14796
Showing
7 changed files
with
97 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
sdk/servicebus/azure-servicebus/tests/async_tests/test_sb_client_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
#-------------------------------------------------------------------------- | ||
|
||
import pytest | ||
|
||
from azure.servicebus.aio import ( | ||
ServiceBusClient) | ||
from uamqp.constants import TransportType | ||
from devtools_testutils import AzureMgmtTestCase, RandomNameResourceGroupPreparer | ||
from servicebus_preparer import ( | ||
ServiceBusNamespacePreparer | ||
) | ||
|
||
class ServiceBusClientAsyncTests(AzureMgmtTestCase): | ||
|
||
@pytest.mark.liveTest | ||
@pytest.mark.live_test_only | ||
@RandomNameResourceGroupPreparer(name_prefix='servicebustest') | ||
@ServiceBusNamespacePreparer(name_prefix='servicebustest') | ||
def test_servicebusclient_from_conn_str_amqpoverwebsocket_async(self, servicebus_namespace_connection_string, **kwargs): | ||
sb_client = ServiceBusClient.from_connection_string(servicebus_namespace_connection_string) | ||
assert sb_client.transport_type == TransportType.Amqp | ||
|
||
websocket_sb_client = ServiceBusClient.from_connection_string(servicebus_namespace_connection_string + ';TransportType=AmqpOverWebsocket') | ||
assert websocket_sb_client.transport_type == TransportType.AmqpOverWebsocket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters