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.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/unit/test_connection.py b/t/unit/test_connection.py
index 13834113..5251f868 100644
--- a/t/unit/test_connection.py
+++ b/t/unit/test_connection.py
@@ -415,6 +415,18 @@ class test_Connection:
conn._close()
conn._default_channel.close.assert_called_with()
+ def test_auto_reconnect_default_channel(self):
+ # tests GH issue: #1208
+ # Tests that default_channel automatically reconnects when connection
+ # closed
+ c = Connection('memory://')
+ c._closed = True
+ with patch.object(
+ c, '_connection_factory', side_effect=c._connection_factory
+ ) as cf_mock:
+ c.default_channel
+ cf_mock.assert_called_once_with()
+
def test_close_when_default_channel_close_raises(self):
class Conn(Connection):