Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066397
D2133.id7165.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D2133.id7165.diff
View Options
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
Details
Attached
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
Attached To
D2133: pytest_plugin: Add support for http request (debian lister related)
Event Timeline
Log In to Comment