Accepting request 330863 from Cloud:OpenStack:Master

- 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
This commit is contained in:
Denisart Benjamin 2015-09-17 11:36:10 +00:00 committed by Git OBS Bridge
parent f04bceca61
commit 324dc2d384
3 changed files with 45 additions and 0 deletions

38
fix-tests.patch Normal file
View File

@ -0,0 +1,38 @@
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())

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Sep 14 08:58:49 UTC 2015 - tbechtold@suse.com
- Add fix-tests.patch to fix testcases with newer python-mock.
-------------------------------------------------------------------
Fri Jul 24 20:07:39 UTC 2015 - seife+obs@b1-systems.com

View File

@ -24,6 +24,7 @@ License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/celery/kombu
Source: http://pypi.python.org/packages/source/k/kombu/kombu-%{version}.tar.gz
Patch0: fix-tests.patch
BuildRequires: python-devel
BuildRequires: python-setuptools
# Test requirements:
@ -71,6 +72,7 @@ provide proven and tested solutions to common messaging problems.
%setup -q -n kombu-%{version}
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' ./kombu/tests/test_serialization.py
%patch0 -p1
%build
python setup.py build