Blame SOURCES/0003-Allow-skipping-purl-tests-if-it-is-not-present.patch

71c54e
From b1844f12934f7a1554fdfaf26cb05261d222a1da Mon Sep 17 00:00:00 2001
71c54e
From: Jamie Lennox <jamielennox@gmail.com>
71c54e
Date: Wed, 4 Dec 2019 22:16:16 +1100
71c54e
Subject: [PATCH] Allow skipping purl tests if it is not present
71c54e
71c54e
Purl is not available in some packaging scenarios, like on fedora.
71c54e
Easiest to just ignore this one if not present.
71c54e
---
71c54e
 tests/test_adapter.py | 9 ++++++++-
71c54e
 1 file changed, 8 insertions(+), 1 deletion(-)
71c54e
71c54e
diff --git a/tests/test_adapter.py b/tests/test_adapter.py
71c54e
index 70d0752..b6aa845 100644
71c54e
--- a/tests/test_adapter.py
71c54e
+++ b/tests/test_adapter.py
71c54e
@@ -16,7 +16,11 @@
71c54e
 import re
71c54e
 import urllib.parse
71c54e
71c54e
-import purl
71c54e
+try:
71c54e
+    import purl
71c54e
+except ImportError:
71c54e
+    purl = None
71c54e
+
71c54e
 import requests
71c54e
 from urllib3 import HTTPResponse
71c54e
71c54e
@@ -346,6 +350,9 @@ class SessionAdapterTests(base.TestCase):
71c54e
             self.assertEqual('resp', resp.text)
71c54e
71c54e
     def test_with_purl(self):
71c54e
+        if purl is None:
71c54e
+            self.skipTest('purl is not present')
71c54e
+
71c54e
         self.adapter.register_uri('GET',
71c54e
                                   purl.URL('mock://www.tester.com/a'),
71c54e
                                   text='resp')
71c54e
--
71c54e
2.21.0
71c54e