Innovenergy_trunk/NodeRed/NodeRedFiles/pika-0.13.1/tests/unit/twisted_tests.py

22 lines
574 B
Python
Raw Normal View History

2024-06-05 10:33:44 +00:00
"""
Tests for pika.adapters.twisted_connection
"""
import unittest
import mock
from pika.adapters import twisted_connection
class TwistedProtocolConnectionTests(unittest.TestCase):
@mock.patch('pika.connection.Connection.add_on_close_callback')
def test_twisted_protocol_connection_call_parent(self, mock_add):
twisted_connection.TwistedProtocolConnection(
None, on_close_callback=self._on_close)
mock_add.assert_called_once_with(self._on_close)
@staticmethod
def _on_close(connection, reply_code, reply_text):
pass