File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
test_elasticsearch/test_client Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def _make_path(*parts):
46
46
quote_plus (_escape (p ), b',*' ) for p in parts if p not in SKIP_IN_PATH )
47
47
48
48
# parameters that apply to all methods
49
- GLOBAL_PARAMS = ('pretty' , 'format' , 'request_timeout' )
49
+ GLOBAL_PARAMS = ('pretty' , 'format' )
50
50
51
51
def query_params (* es_query_params ):
52
52
"""
@@ -61,9 +61,10 @@ def _wrapped(*args, **kwargs):
61
61
if p in kwargs :
62
62
params [p ] = _escape (kwargs .pop (p ))
63
63
64
- # don't treat ignore as other params to avoid escaping
65
- if 'ignore' in kwargs :
66
- params ['ignore' ] = kwargs .pop ('ignore' )
64
+ # don't treat ignore and request_timeout as other params to avoid escaping
65
+ for p in ('ignore' , 'request_timeout' ):
66
+ if p in kwargs :
67
+ params [p ] = kwargs .pop (p )
67
68
return func (* args , params = params , ** kwargs )
68
69
return _wrapped
69
70
return _wrapper
Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ def test_single_string_is_wrapped_in_list(self):
39
39
40
40
41
41
class TestClient (ElasticsearchTestCase ):
42
+ def test_request_timeout_is_passed_through_unescaped (self ):
43
+ self .client .ping (request_timeout = .1 )
44
+ calls = self .assert_url_called ('HEAD' , '/' )
45
+ self .assertEquals ([({'request_timeout' : .1 }, None )], calls )
46
+
42
47
def test_from_in_search (self ):
43
48
self .client .search (index = 'i' , doc_type = 't' , from_ = 10 )
44
49
calls = self .assert_url_called ('GET' , '/i/t/_search' )
You can’t perform that action at this time.
0 commit comments