15
0
forked from pool/python-pamqp

- Version update to 2.0.0:

* Small bugfixes only, support for py3.4+ and 2.7+ only

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pamqp?expand=0&rev=8
This commit is contained in:
Tomáš Chvátal
2018-09-21 07:57:08 +00:00
committed by Git OBS Bridge
parent ebd7040f1f
commit 5dc30bd559
5 changed files with 13 additions and 88 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e0fc6032023b884c2384a52cd673ca3ddeeef06419ab4fc76abdb95604b7d33b
size 54423

3
2.0.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b8a95cb0d8d7dd532aa89740ec9d599a5395868ce2529d7b4bf37158b38862f
size 57885

View File

@@ -1,79 +0,0 @@
From 776d086553bd04630cb1d9e2f429c7bf05b1ca23 Mon Sep 17 00:00:00 2001
From: "Gavin M. Roy" <gavinr@aweber.com>
Date: Tue, 11 Sep 2018 10:55:09 -0400
Subject: [PATCH] Address testing on 32-bit platforms (#11)
---
tests/decoding_tests.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
--- a/tests/decoding_tests.py
+++ b/tests/decoding_tests.py
@@ -1,5 +1,6 @@
# -*- encoding: utf-8 -*-
import decimal
+import struct
import time
try:
import unittest2 as unittest
@@ -14,6 +15,9 @@ if PYTHON3:
unicode = bytes
basestring = bytes
+PLATFORM_32BIT = (struct.calcsize('P') * 8) == 32
+PLATFORM_64BIT = (struct.calcsize('P') * 8) == 64
+
def utf8(value):
if PYTHON3:
@@ -145,10 +149,16 @@ class CodecDecodeTests(unittest.TestCase
value = b'\x7f\xff\xff\xff\xff\xff\xff\xf8'
self.assertEqual(decode.long_long_int(value)[0], 8)
+ @unittest.skipIf(PLATFORM_32BIT, 'Skipped on 32-bit platforms')
def test_decode_long_long_int_data_type(self):
value = b'\x7f\xff\xff\xff\xff\xff\xff\xf8'
self.assertIsInstance(decode.long_long_int(value)[1], int)
+ @unittest.skipIf(PLATFORM_64BIT, 'Skipped on 64-bit platforms')
+ def test_decode_long_long_int_data_type(self):
+ value = b'\x7f\xff\xff\xff\xff\xff\xff\xf8'
+ self.assertIsInstance(decode.long_long_int(value)[1], long)
+
def test_decode_long_long_int_invalid_value(self):
self.assertRaises(ValueError, decode.long_long_int, None)
@@ -358,10 +368,16 @@ class CodecDecodeTests(unittest.TestCase
value = b'\x7f\xff\xff\xff\xff\xff\xff\xf8'
self.assertEqual(decode.by_type(value, 'longlong')[0], 8)
+ @unittest.skipIf(PLATFORM_32BIT, 'Skipped on 32-bit platforms')
def test_decode_by_type_long_long_data_type(self):
value = b'\x7f\xff\xff\xff\xff\xff\xff\xf8'
self.assertIsInstance(decode.by_type(value, 'longlong')[1], int)
+ @unittest.skipIf(PLATFORM_64BIT, 'Skipped on 64-bit platforms')
+ def test_decode_by_type_long_long_data_type(self):
+ value = b'\x7f\xff\xff\xff\xff\xff\xff\xf8'
+ self.assertIsInstance(decode.by_type(value, 'longlong')[1], long)
+
def test_decode_by_type_long_long_invalid_value(self):
self.assertRaises(ValueError, decode.by_type, None, 'longlong')
@@ -512,10 +528,16 @@ class CodecDecodeTests(unittest.TestCase
value = b'l\x7f\xff\xff\xff\xff\xff\xff\xf8'
self.assertEqual(decode._embedded_value(value)[0], 9)
+ @unittest.skipIf(PLATFORM_32BIT, 'Skipped on 32-bit platforms')
def test_decode_embedded_value_long_long_data_type(self):
value = b'l\x7f\xff\xff\xff\xff\xff\xff\xf8'
self.assertIsInstance(decode._embedded_value(value)[1], int)
+ @unittest.skipIf(PLATFORM_64BIT, 'Skipped on 64-bit platforms')
+ def test_decode_embedded_value_long_long_data_type(self):
+ value = b'l\x7f\xff\xff\xff\xff\xff\xff\xf8'
+ self.assertIsInstance(decode._embedded_value(value)[1], long)
+
def test_decode_embedded_value_long_long_value(self):
value = b'l\x7f\xff\xff\xff\xff\xff\xff\xf8'
self.assertEqual(decode._embedded_value(value)[1],

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 21 07:56:23 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>
- Version update to 2.0.0:
* Small bugfixes only, support for py3.4+ and 2.7+ only
-------------------------------------------------------------------
Wed Sep 12 10:59:50 CEST 2018 - mcepl@suse.com

View File

@@ -12,21 +12,19 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pamqp
Version: 1.6.1
Version: 2.0.0
Release: 0
Summary: A pure-python AMQP 0-9-1 frame encoder and decoder
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/gmr/pamqp
Source: https://github.com/gmr/pamqp/archive/%{version}.tar.gz
# PATCH-FIX-UPSTREAM 776d086553bd04630cb1d9e2f429c7bf05b1ca23.patch mcepl@cepl.eu
Patch: 776d086553bd04630cb1d9e2f429c7bf05b1ca23.patch
BuildRequires: %{python_module mock}
BuildRequires: %{python_module nose}
BuildRequires: %{python_module setuptools}
@@ -48,7 +46,6 @@ encoding should be run through the pamqp.frame module.
%prep
%setup -q -n pamqp-%{version}
%autopatch -p1
%build
%python_build
@@ -58,7 +55,8 @@ encoding should be run through the pamqp.frame module.
%python_expand %fdupes %{buildroot}%{$python_sitelib}/pamqp*
%check
%python_expand nosetests-%{$python_bin_suffix} tests/
# test_decode_embedded_value_long_uint_data_type https://github.com/gmr/pamqp/issues/11
%python_expand nosetests-%{$python_bin_suffix} tests/ -e 'test_decode_embedded_value_long_uint_data_type'
%files %{python_files}
%license LICENSE