14
0

Accepting request 927344 from home:mnhauke

- Update to version 2.2.0
  * New: allow customizing how error PDUs are handled
  * New: ignoring unknown optional parameters
  * New: add the option to create TLS/SSL sockets
  * Fix: the max check should include the NULL terminator
  * Fix: not always setting the socket timeout
  * Fix: add mandatory parameters to GenericNack command
  * Fix: handle errors on PDU payload retrieval
- Drop patch:
  * python-smpplib-use-unittest-mock.patch

OBS-URL: https://build.opensuse.org/request/show/927344
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-smpplib?expand=0&rev=4
This commit is contained in:
2021-11-06 10:35:50 +00:00
committed by Git OBS Bridge
parent 9fe012374e
commit 973190aaa8
5 changed files with 23 additions and 66 deletions

View File

@@ -1,56 +0,0 @@
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 6ae73bb..a5b583a 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -25,7 +25,7 @@ jobs:
virtualenv -p "$(which python || which pypy)" ./venv
)
. venv/bin/activate
- pip install pytest mock
+ pip install pytest
- run:
name: Install project
command: |
diff --git a/setup.py b/setup.py
index 8940285..ea154e1 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ setup(
long_description_content_type='text/markdown',
packages=find_packages(),
install_requires=['six'],
- tests_require=['pytest', 'mock', 'tox'],
+ tests_require=['pytest', 'tox'],
zip_safe=True,
classifiers=[
'Development Status :: 5 - Production/Stable',
diff --git a/tests/test_gsm.py b/tests/test_gsm.py
index b6641fd..7760dc4 100644
--- a/tests/test_gsm.py
+++ b/tests/test_gsm.py
@@ -1,6 +1,6 @@
# -*- coding: utf8 -*-
-import mock
+from unittest.mock import patch
from pytest import mark, raises
from smpplib import consts
@@ -39,7 +39,7 @@ def test_make_parts_single(plaintext, encoding, expected_parts, expected_encodin
]),
])
def test_make_parts_multiple(plaintext, expected):
- with mock.patch('random.randint') as randint:
+ with patch('random.randint') as randint:
randint.return_value = 0x42
assert make_parts(plaintext) == (expected, consts.SMPP_ENCODING_DEFAULT, consts.SMPP_GSMFEAT_UDHI)
@@ -49,7 +49,7 @@ def test_make_parts_multiple(plaintext, expected):
(b'12345', 2, [b'\x05\x00\x03\x42\x03\x0112', b'\x05\x00\x03\x42\x03\x0234', b'\x05\x00\x03\x42\x03\x035']),
])
def test_make_parts_encoded(encoded_text, part_size, expected):
- with mock.patch('random.randint') as randint:
+ with patch('random.randint') as randint:
randint.return_value = 0x42
assert make_parts_encoded(encoded_text, part_size) == expected

View File

@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Mon Oct 25 19:33:46 UTC 2021 - Martin Hauke <mardnh@gmx.de>
- Update to version 2.2.0
* New: allow customizing how error PDUs are handled
* New: ignoring unknown optional parameters
* New: add the option to create TLS/SSL sockets
* Fix: the max check should include the NULL terminator
* Fix: not always setting the socket timeout
* Fix: add mandatory parameters to GenericNack command
* Fix: handle errors on PDU payload retrieval
- Drop patch:
* python-smpplib-use-unittest-mock.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Sep 7 07:26:54 UTC 2020 - Martin Hauke <mardnh@gmx.de> Mon Sep 7 07:26:54 UTC 2020 - Martin Hauke <mardnh@gmx.de>

View File

@@ -1,8 +1,8 @@
# #
# spec file for package python-smpplib # spec file for package python-smpplib
# #
# Copyright (c) 2020 SUSE LLC # Copyright (c) 2021 SUSE LLC
# Copyright (c) 2016-2020, Martin Hauke <mardnh@gmx.de> # Copyright (c) 2016-2021, Martin Hauke <mardnh@gmx.de>
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-smpplib Name: python-smpplib
Version: 2.1.0 Version: 2.2.0
Release: 0 Release: 0
Summary: SMPP library for Python Summary: SMPP library for Python
License: LGPL-2.0-only License: LGPL-2.0-only
@@ -27,11 +27,11 @@ Group: Development/Languages/Python
URL: https://pypi.org/project/smpplib/ URL: https://pypi.org/project/smpplib/
#Git-Clone: https://github.com/python-smpplib/python-smpplib.git #Git-Clone: https://github.com/python-smpplib/python-smpplib.git
Source: https://github.com/python-smpplib/python-smpplib/archive/%{version}.tar.gz#/smpplib-%{version}.tar.gz Source: https://github.com/python-smpplib/python-smpplib/archive/%{version}.tar.gz#/smpplib-%{version}.tar.gz
Patch0: python-smpplib-use-unittest-mock.patch
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
# SECTION test requirements # SECTION test requirements
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module mock}
# /SECTION # /SECTION
BuildRequires: fdupes BuildRequires: fdupes
Requires: python-six Requires: python-six
@@ -46,7 +46,6 @@ allows you to send and receive SMS to an SMS gateway or SMSC.
%prep %prep
%setup -q -n python-smpplib-%{version} %setup -q -n python-smpplib-%{version}
%patch0 -p1
%build %build
%python_build %python_build
@@ -54,7 +53,7 @@ allows you to send and receive SMS to an SMS gateway or SMSC.
%install %install
%python_install %python_install
# Remove tests from sitelib # Remove tests from sitelib
%python_expand rm -R %{buildroot}%{$python_sitelib}/tests %python_expand rm -R %{buildroot}%{$python_sitelib}/smpplib/tests/
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check

View File

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

3
smpplib-2.2.0.tar.gz Normal file
View File

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