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