From 324dc2d384ed28485083e6ab5a0d2c922e169ecdad8b43f91e9245b9a2f93e04 Mon Sep 17 00:00:00 2001
From: Denisart Benjamin
Date: Thu, 17 Sep 2015 11:36:10 +0000
Subject: [PATCH] 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
---
fix-tests.patch | 38 ++++++++++++++++++++++++++++++++++++++
python-kombu.changes | 5 +++++
python-kombu.spec | 2 ++
3 files changed, 45 insertions(+)
create mode 100644 fix-tests.patch
diff --git a/fix-tests.patch b/fix-tests.patch
new file mode 100644
index 0000000..faabaff
--- /dev/null
+++ b/fix-tests.patch
@@ -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())
diff --git a/python-kombu.changes b/python-kombu.changes
index 34db943..318a67c 100644
--- a/python-kombu.changes
+++ b/python-kombu.changes
@@ -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
diff --git a/python-kombu.spec b/python-kombu.spec
index 1cd3f89..4962e8a 100644
--- a/python-kombu.spec
+++ b/python-kombu.spec
@@ -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