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):
4646 quote_plus (_escape (p ), b',*' ) for p in parts if p not in SKIP_IN_PATH )
4747
4848# parameters that apply to all methods
49- GLOBAL_PARAMS = ('pretty' , 'format' , 'request_timeout' )
49+ GLOBAL_PARAMS = ('pretty' , 'format' )
5050
5151def query_params (* es_query_params ):
5252 """
@@ -61,9 +61,10 @@ def _wrapped(*args, **kwargs):
6161 if p in kwargs :
6262 params [p ] = _escape (kwargs .pop (p ))
6363
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 )
6768 return func (* args , params = params , ** kwargs )
6869 return _wrapped
6970 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):
3939
4040
4141class 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+
4247 def test_from_in_search (self ):
4348 self .client .search (index = 'i' , doc_type = 't' , from_ = 10 )
4449 calls = self .assert_url_called ('GET' , '/i/t/_search' )
You can’t perform that action at this time.
0 commit comments