Page MenuHomeSoftware Heritage

D2133.id7165.diff
No OneTemporary

D2133.id7165.diff

diff --git a/swh/core/pytest_plugin.py b/swh/core/pytest_plugin.py
--- a/swh/core/pytest_plugin.py
+++ b/swh/core/pytest_plugin.py
@@ -159,10 +159,10 @@
cb = partial(get_response_cb,
ignore_urls=ignore_urls,
datadir=datadir)
- requests_mock.get(re.compile('https://'), body=cb)
+ requests_mock.get(re.compile('http[s]{0,1}://'), body=cb)
else:
visits = {}
- requests_mock.get(re.compile('https://'), body=partial(
+ requests_mock.get(re.compile('http[s]{0,1}://'), body=partial(
get_response_cb, ignore_urls=ignore_urls, visits=visits,
datadir=datadir)
)
diff --git a/swh/core/tests/test_pytest_plugin.py b/swh/core/tests/test_pytest_plugin.py
--- a/swh/core/tests/test_pytest_plugin.py
+++ b/swh/core/tests/test_pytest_plugin.py
@@ -15,6 +15,10 @@
assert response.ok
assert response.json() == {'hello': 'you'}
+ response = requests.get('http://example.com/file.json')
+ assert response.ok
+ assert response.json() == {'hello': 'you'}
+
response = requests.get('https://example.com/file.json')
assert response.ok
assert response.json() == {'hello': 'world'}

File Metadata

Mime Type
text/plain
Expires
Nov 5 2024, 7:47 AM (8 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225695

Event Timeline