Skip to content
Myr

Added unit tests for hooks module

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Dmitry Dygalo · committed by Dmitry Dygalo · parent 190cddd · Browse files · 1 file+22 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+22 added−0 removed

  • tests:+22 added−0 removed

1 file+22 added−0 removed

added:tests/test_hooks.py+22 added
1# coding: utf-82import pytest34from requests import hooks567def hook(value):8 return value[1:]91011@pytest.mark.parametrize(12 'hooks_list, result', (13 (hook, 'ata'),14 ([hook, lambda x: None, hook], 'ta'),15 )16)17def test_hooks(hooks_list, result):18 assert hooks.dispatch_hook('response', {'response': hooks_list}, 'Data') == result192021def test_default_hooks():22 assert hooks.default_hooks() == {'response': []}