forked from pool/python-kombu
324dc2d384
- Add fix-tests.patch to fix testcases with newer python-mock. OBS-URL: https://build.opensuse.org/request/show/330863 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-kombu?expand=0&rev=110
39 lines
1.8 KiB
Diff
39 lines
1.8 KiB
Diff
Index: kombu-3.0.26/kombu/tests/transport/test_qpid.py
|
|
===================================================================
|
|
--- kombu-3.0.26.orig/kombu/tests/transport/test_qpid.py
|
|
+++ kombu-3.0.26/kombu/tests/transport/test_qpid.py
|
|
@@ -1155,7 +1155,7 @@ class TestChannel(ExtraAssertionsMixin,
|
|
self.mock_broker.addQueue.side_effect = unique_exception
|
|
with self.assertRaises(unique_exception.__class__):
|
|
self.my_channel.queue_declare(mock_queue)
|
|
- self.mock_broker.addQueue.assert_called_once()
|
|
+ assert self.mock_broker.addQueue.called
|
|
|
|
def test_exchange_declare_raises_exception_and_silenced(self):
|
|
"""Create exchange where an exception is raised and then silenced"""
|
|
@@ -1308,10 +1308,10 @@ class TestChannel(ExtraAssertionsMixin,
|
|
self.my_channel.basic_publish(
|
|
mock_message, mock_exchange, mock_routing_key,
|
|
)
|
|
- mock_encode_body.assert_called_once(
|
|
+ mock_encode_body.assert_called_once_with(
|
|
mock_original_body, mock_body_encoding,
|
|
)
|
|
- mock_buffer.assert_called_once(mock_encode_body)
|
|
+ mock_buffer.assert_called_once_with(mock_encoded_body)
|
|
self.assertIs(mock_message['body'], mock_encoded_buffered_body)
|
|
self.assertIs(
|
|
mock_message['properties']['body_encoding'], mock_body_encoding,
|
|
@@ -1567,8 +1567,9 @@ class TestTransportInit(Case):
|
|
self.mock_verify_runtime_environment.assert_called_once_with()
|
|
|
|
def test_transport___init___calls_parent_class___init__(self):
|
|
- Transport(Mock())
|
|
- self.mock_base_Transport__init__.assert_caled_once_with()
|
|
+ m = Mock()
|
|
+ Transport(m)
|
|
+ self.mock_base_Transport__init__.assert_called_once_with(m)
|
|
|
|
def test_transport___init___calls_os_pipe(self):
|
|
Transport(Mock())
|