summaryrefslogtreecommitdiff
path: root/t/unit/test_connection.py
diff options
context:
space:
mode:
Diffstat (limited to 't/unit/test_connection.py')
-rw-r--r--t/unit/test_connection.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/unit/test_connection.py b/t/unit/test_connection.py
index a2489bc3..9161338e 100644
--- a/t/unit/test_connection.py
+++ b/t/unit/test_connection.py
@@ -299,6 +299,16 @@ class test_Connection:
assert c.hostname == 'foo'
assert c.transport_cls, ('librabbitmq', 'pyamqp' in 'amqp')
+ def test_switch_without_uri_identifier(self):
+ c = Connection('amqp://foo')
+ assert c.hostname == 'foo'
+ assert c.transport_cls, ('librabbitmq', 'pyamqp' in 'amqp')
+ c._closed = True
+ c.switch('example.com')
+ assert not c._closed
+ assert c.hostname == 'example.com'
+ assert c.transport_cls, ('librabbitmq', 'pyamqp' in 'amqp')
+
def test_heartbeat_check(self):
c = Connection(transport=Transport)
c.transport.heartbeat_check = Mock()