14
0

Accepting request 1221438 from home:pgajdos:python

- do not require python-purl
- added patches
  fix https://github.com/jamielennox/requests-mock/issues/266
  + python-requests-mock-no-purl.patch

OBS-URL: https://build.opensuse.org/request/show/1221438
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-requests-mock?expand=0&rev=64
This commit is contained in:
2024-11-05 15:33:11 +00:00
committed by Git OBS Bridge
parent c605fc2727
commit ba782d466c
3 changed files with 38 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
Index: requests-mock-1.12.1/tests/test_adapter.py
===================================================================
--- requests-mock-1.12.1.orig/tests/test_adapter.py
+++ requests-mock-1.12.1/tests/test_adapter.py
@@ -14,9 +14,14 @@ import http.client
import io
import json
import re
+import unittest
import urllib.parse
-import purl
+with_purl = True
+try:
+ import purl
+except:
+ with_purl = False
import requests
from urllib3 import HTTPResponse
@@ -345,6 +350,7 @@ class SessionAdapterTests(base.TestCase)
resp = self.session.get(u)
self.assertEqual('resp', resp.text)
+ @unittest.skipUnless(with_purl, "purl not available")
def test_with_purl(self):
self.adapter.register_uri('GET',
purl.URL('mock://www.tester.com/a'),