repositori / bagas / requests

requests public ready

https://github.com/psf/requests commit 3c7baaa 48 berkas · 374 potongan 2026-11-21T15:17:50Z
48berkas
36berkas python
374potongan
python 36 markdown 5 yaml 2 text 2 toml 1 css 1 html 1
tests/test_hooks.pypython 22 baris ditampilkan
1
import pytest
2
3
from requests import hooks
4
5
6
def hook(value):
7
return value[1:]
8
9
10
@pytest.mark.parametrize(
11
"hooks_list, result",
12
(
13
(hook, "ata"),
14
([hook, lambda x: None, hook], "ta"),
15
),
16
)
17
def test_hooks(hooks_list, result):
18
assert hooks.dispatch_hook("response", {"response": hooks_list}, "Data") == result
19
20
21
def test_default_hooks():
22
assert hooks.default_hooks() == {"response": []}