From a19e95715f50a08e9ead752dae41c739b97d8a5910109e859b2c814da6c12ec0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 24 Jul 2020 00:48:30 +0000 Subject: [PATCH 1/2] - Add skip-missing-LDAP-server.patch to skip over tests failing because of the missing local LDAP server running (gh#cannatag/ldap3#843). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ldap3?expand=0&rev=33 --- python-ldap3.changes | 6 ++++++ python-ldap3.spec | 11 +++++++++-- skip-missing-LDAP-server.patch | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 skip-missing-LDAP-server.patch diff --git a/python-ldap3.changes b/python-ldap3.changes index d2b8322..9b118e5 100644 --- a/python-ldap3.changes +++ b/python-ldap3.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jul 24 00:46:48 UTC 2020 - Matej Cepl + +- Add skip-missing-LDAP-server.patch to skip over tests failing because + of the missing local LDAP server running (gh#cannatag/ldap3#843). + ------------------------------------------------------------------- Fri May 15 15:55:38 UTC 2020 - Antonio Larrosa diff --git a/python-ldap3.spec b/python-ldap3.spec index c62e099..fd7b0c4 100644 --- a/python-ldap3.spec +++ b/python-ldap3.spec @@ -24,8 +24,12 @@ Summary: A strictly RFC 4511 conforming LDAP V3 pure Python client License: LGPL-3.0-only URL: https://github.com/cannatag/ldap3 Source: https://github.com/cannatag/ldap3/archive/v%{version}.tar.gz -BuildRequires: %{python_module nose} +# PATCH-FIX-UPSTREAM skip-missing-LDAP-server.patch gh#cannatag/ldap3#843 mcepl@suse.com +# skip over tests failing because of the missing local LDAP server running +Patch0: skip-missing-LDAP-server.patch +# BuildRequires: %%{python_module nose} BuildRequires: %{python_module pyasn1 >= 0.4.6} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: dos2unix BuildRequires: fdupes @@ -44,6 +48,8 @@ The name has been changed to avoid confusion with the python-ldap library. %prep %setup -q -n ldap3-%{version} +%autopatch -p1 + dos2unix COPYING.LESSER.txt COPYING.txt README.rst LICENSE.txt %build @@ -54,7 +60,8 @@ dos2unix COPYING.LESSER.txt COPYING.txt README.rst LICENSE.txt %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_exec %{_bindir}/nosetests -s test || : +export STRATEGY=SYNC SERVER=EDIR DECODER=INTERNAL +%pytest test/test*.py %files %{python_files} %license COPYING.LESSER.txt COPYING.txt LICENSE.txt diff --git a/skip-missing-LDAP-server.patch b/skip-missing-LDAP-server.patch new file mode 100644 index 0000000..ad9b5df --- /dev/null +++ b/skip-missing-LDAP-server.patch @@ -0,0 +1,19 @@ +--- a/test/config.py ++++ b/test/config.py +@@ -25,6 +25,7 @@ from os import environ, remove + from os import path + from random import SystemRandom + from tempfile import gettempdir ++from unittest import SkipTest + + from ldap3 import SIMPLE, SYNC, ROUND_ROBIN, IP_V6_PREFERRED, IP_SYSTEM_DEFAULT, Server, Connection,\ + ServerPool, SASL, STRING_TYPES, get_config_parameter, set_config_parameter, \ +@@ -380,7 +381,7 @@ elif location == 'W10GC9227-AD': + test_logging_filename = path.join(gettempdir(), 'ldap3.log') + test_valid_names = ['10.160.201.232'] + else: +- raise Exception('testing location ' + location + ' is not valid') ++ raise SkipTest('testing location ' + location + ' is not valid') + + if test_logging: + try: From 0fd868909439d03cacb574334444ebdba8d8f7a01f629116e209d423111bc327 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 24 Jul 2020 00:56:21 +0000 Subject: [PATCH 2/2] Actually remove BR, not just comment it out OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ldap3?expand=0&rev=34 --- python-ldap3.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python-ldap3.spec b/python-ldap3.spec index fd7b0c4..7c59d9a 100644 --- a/python-ldap3.spec +++ b/python-ldap3.spec @@ -27,7 +27,6 @@ Source: https://github.com/cannatag/ldap3/archive/v%{version}.tar.gz # PATCH-FIX-UPSTREAM skip-missing-LDAP-server.patch gh#cannatag/ldap3#843 mcepl@suse.com # skip over tests failing because of the missing local LDAP server running Patch0: skip-missing-LDAP-server.patch -# BuildRequires: %%{python_module nose} BuildRequires: %{python_module pyasn1 >= 0.4.6} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools}