Accepting request 331677 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/331677
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-kombu?expand=0&rev=46
This commit is contained in:
Dominique Leuenberger 2015-10-01 07:28:54 +00:00 committed by Git OBS Bridge
commit d3dcb180b2
3 changed files with 52 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,13 @@
-------------------------------------------------------------------
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
- fix non-SUSE build by conditionalizing Suggests: tag
-------------------------------------------------------------------
Thu May 7 09:39:00 UTC 2015 - benoit.monin@gmx.fr

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:
@ -43,9 +44,11 @@ Requires: python-ordereddict
%endif
Requires: python-amqp >= 1.4.6
Requires: python-anyjson >= 0.3.3
%if 0%{?suse_version}
Suggests: couchdb
Suggests: mongodb
Suggests: rabbitmq-server
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@ -69,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