Update dependencies in test suite

Merges: #3
This commit is contained in:
Robbie Harwood 2018-08-09 15:13:29 -04:00
parent 8c775f8ac4
commit 8dddb7aa04
2 changed files with 51 additions and 11 deletions

View File

@ -0,0 +1,36 @@
From 903d77cb73bd6713279f1d9920f5f665293a26c2 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood@redhat.com>
Date: Thu, 9 Aug 2018 14:57:56 -0400
Subject: [PATCH] Make webtest an optional dependency
Resolves: #38
(cherry picked from commit c0bee88c60deb176d420d90447d24c370d70727a)
---
tests.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests.py b/tests.py
index 992529f..c2b1fc0 100644
--- a/tests.py
+++ b/tests.py
@@ -33,7 +33,11 @@ from dns.rdataclass import IN as RDCLASS_IN
from dns.rdatatype import SRV as RDTYPE_SRV
from dns.rdtypes.IN.SRV import SRV
-from webtest import TestApp as WebTestApp
+try:
+ from webtest import TestApp as WebTestApp
+except ImportError:
+ print("webtest not installed! Tests will be skipped")
+ WebTestApp = "skip"
import kdcproxy
from kdcproxy import codec
@@ -45,6 +49,7 @@ HERE = os.path.dirname(os.path.abspath(__file__))
KRB5_CONFIG = os.path.join(HERE, 'tests.krb5.conf')
+@unittest.skipIf(WebTestApp == "skip", "webtest not installed")
class KDCProxyWSGITests(unittest.TestCase):
addrinfo = [
(2, 1, 6, '', ('128.66.0.2', 88)),

View File

@ -14,23 +14,23 @@
Name: python-%{realname}
Version: 0.4
Release: 1%{?dist}
Release: 2%{?dist}
Summary: MS-KKDCP (kerberos proxy) WSGI module
License: MIT
URL: https://github.com/npmccallum/%{realname}
Source0: https://github.com/npmccallum/%{realname}/archive/%{realname}-%{version}.tar.gz
Patch0: Make-webtest-an-optional-dependency.patch
BuildArch: noarch
BuildRequires: /usr/bin/tox
BuildRequires: git
%if 0%{?with_python2} > 0
BuildRequires: python2-devel
BuildRequires: python2-pytest
BuildRequires: python2-coverage
BuildRequires: python2-webtest
BuildRequires: python2-pyasn1
BuildRequires: python2-asn1crypto
BuildRequires: python2-dns
BuildRequires: python2-mock
%endif
@ -39,8 +39,7 @@ BuildRequires: python2-mock
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-coverage
BuildRequires: python3-webtest
BuildRequires: python3-pyasn1
BuildRequires: python3-asn1crypto
BuildRequires: python3-dns
BuildRequires: python3-mock
%endif
@ -55,7 +54,7 @@ minimal configuration.
%package -n python2-%{realname}
Summary: MS-KKDCP (kerberos proxy) WSGI module
Requires: python2-dns
Requires: python2-pyasn1
Requires: python2-asn1crypto
%{?python_provide:%python_provide python2-%{realname}}
@ -69,7 +68,7 @@ minimal configuration.
%package -n python3-%{realname}
Summary: MS-KKDCP (kerberos proxy) WSGI module
Requires: python3-dns
Requires: python3-pyasn1
Requires: python3-asn1crypto
%{?python_provide:%python_provide python3-%{realname}}
@ -100,9 +99,11 @@ minimal configuration.
%endif
%check
%if 0%{?rhel} == 0
# Ignore results due to https://github.com/latchset/kdcproxy/issues/35
tox --sitepackages -e py%{python2_version_nodots},py%{python3_version_nodots} || :
%if 0%{?with_python2} > 0
KDCPROXY_ASN1MOD=asn1crypto %{__python2} -m pytest
%endif
%if 0%{?with_python3} > 0
KDCPROXY_ASN1MOD=asn1crypto %{__python3} -m pytest
%endif
%if 0%{?with_python2} > 0
@ -122,6 +123,9 @@ tox --sitepackages -e py%{python2_version_nodots},py%{python3_version_nodots} ||
%endif
%changelog
* Thu Aug 09 2018 Robbie Harwood <rharwood@redhat.com> - 0.4-2
- Update dependencies in test suite
* Thu Aug 09 2018 Robbie Harwood <rharwood@redhat.com> - 0.4-1
- New upstream release - 0.4
- Port to autosetup