diff options
author | Jesus Rivero <neurogeek@gentoo.org> | 2012-03-02 22:15:19 +0000 |
---|---|---|
committer | Jesus Rivero <neurogeek@gentoo.org> | 2012-03-02 22:15:19 +0000 |
commit | 75aace504bbb987a4ee380ab44280d6329893e43 (patch) | |
tree | 676061598839c9f239362092747e3f5e231200b5 /dev-python/amqplib | |
parent | Marking File-Which-1.90.0 ppc64 for bug 400117 (diff) | |
download | gentoo-2-75aace504bbb987a4ee380ab44280d6329893e43.tar.gz gentoo-2-75aace504bbb987a4ee380ab44280d6329893e43.tar.bz2 gentoo-2-75aace504bbb987a4ee380ab44280d6329893e43.zip |
Added Python3 support and some patches to the tests
(Portage version: 2.2.0_alpha89/cvs/Linux i686)
Diffstat (limited to 'dev-python/amqplib')
-rw-r--r-- | dev-python/amqplib/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/amqplib/amqplib-1.0.2.ebuild | 9 | ||||
-rw-r--r-- | dev-python/amqplib/files/amqplib-1.0.2-unicode_tests_py3.patch | 63 |
3 files changed, 73 insertions, 7 deletions
diff --git a/dev-python/amqplib/ChangeLog b/dev-python/amqplib/ChangeLog index 9d6d07776897..b439acdbfce4 100644 --- a/dev-python/amqplib/ChangeLog +++ b/dev-python/amqplib/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-python/amqplib -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/amqplib/ChangeLog,v 1.2 2011/12/25 14:54:35 patrick Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/amqplib/ChangeLog,v 1.3 2012/03/02 22:15:19 neurogeek Exp $ + + 02 Mar 2012; Jesus Rivero <neurogeek@gentoo.org> amqplib-1.0.2.ebuild, + +files/amqplib-1.0.2-unicode_tests_py3.patch: + Added Python3 support and some patches to the tests *amqplib-1.0.2 (25 Dec 2011) diff --git a/dev-python/amqplib/amqplib-1.0.2.ebuild b/dev-python/amqplib/amqplib-1.0.2.ebuild index 20ae29d2cf6c..21d8e1cada37 100644 --- a/dev-python/amqplib/amqplib-1.0.2.ebuild +++ b/dev-python/amqplib/amqplib-1.0.2.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/amqplib/amqplib-1.0.2.ebuild,v 1.1 2011/12/25 14:54:35 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/amqplib/amqplib-1.0.2.ebuild,v 1.2 2012/03/02 22:15:19 neurogeek Exp $ EAPI="3" -PYTHON_DEPEND="2" +PYTHON_DEPEND="2 3" SUPPORT_PYTHON_ABIS="1" inherit distutils eutils @@ -20,11 +20,10 @@ IUSE="examples extras test" RDEPEND="" DEPEND="${RDEPEND}" -RESTRICT_PYTHON_ABIS="3.*" - src_prepare() { if use test; then epatch "${FILESDIR}/${PN}-0.6.1_disable_socket_tests.patch" + epatch "${FILESDIR}/${P}-unicode_tests_py3.patch" fi } diff --git a/dev-python/amqplib/files/amqplib-1.0.2-unicode_tests_py3.patch b/dev-python/amqplib/files/amqplib-1.0.2-unicode_tests_py3.patch new file mode 100644 index 000000000000..14252a678203 --- /dev/null +++ b/dev-python/amqplib/files/amqplib-1.0.2-unicode_tests_py3.patch @@ -0,0 +1,63 @@ +--- a/tests/client_0_8/test_serialization.py 2011-07-18 00:11:48.000000000 -0400 ++++ b/tests/client_0_8/test_serialization.py 2012-03-02 16:54:35.000000000 -0500 +@@ -32,6 +32,18 @@ + # Python 2.5 and lower + bytes = str + ++#Unicode Strings for py3 tests ++uni_strings = { ++ 'u0100' : '\u0100', ++ 'hello' : 'hello', ++ 'a' : 'a', ++ 'another' : 'And something in unicode' ++} ++ ++if hasattr(str, 'decode'): ++ for wk, wv in uni_strings.iteritems(): ++ uni_strings[wk] = wv.decode("utf-8") ++ + import settings + + from amqplib.client_0_8.serialization import AMQPReader, AMQPWriter, GenericContent +@@ -232,12 +244,12 @@ + + def test_shortstr_unicode(self): + w = AMQPWriter() +- w.write_shortstr(u'hello') ++ w.write_shortstr(uni_strings['hello']) + s = w.getvalue() + self.assertEqualBinary(s, '\x05hello') + + r = AMQPReader(s) +- self.assertEqual(r.read_shortstr(), u'hello') ++ self.assertEqual(r.read_shortstr(),uni_strings['hello']) + + def test_long_shortstr(self): + w = AMQPWriter() +@@ -245,7 +257,7 @@ + + def test_long_shortstr_unicode(self): + w = AMQPWriter() +- self.assertRaises(ValueError, w.write_shortstr, u'\u0100' * 128) ++ self.assertRaises(ValueError, w.write_shortstr, uni_strings['u0100'] * 128) + + + # +@@ -273,7 +285,7 @@ + self.assertEqual(r.read_longstr(), str(val)) + + def test_longstr_unicode(self): +- val = u'a' * 512 ++ val = uni_strings['a'] * 512 + w = AMQPWriter() + w.write_longstr(val) + s = w.getvalue() +@@ -324,7 +336,7 @@ + 'foo': 7, + 'bar': Decimal('123345.1234'), + 'baz': 'this is some random string I typed', +- 'ubaz': u'And something in unicode', ++ 'ubaz': uni_strings['another'], + 'dday_aniv': datetime(1994, 6, 6), + 'more': { + 'abc': -123, |