File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1717import context
1818import pytest
1919import solnlib
20- import sys
20+ from time import sleep
2121from splunklib import binding
2222from solnlib import splunk_rest_client as rest_client
2323
2626
2727def test_rest_client_user_agent ():
2828 test_url = r'search index = _internal uri_path="*/servicesNS/nobody/test_app/some/unexisting/url"'
29- user_agent = f"solnlib/{ solnlib .__version__ } rest-client { sys . platform } "
29+ user_agent = f"solnlib/{ solnlib .__version__ } rest-client linux "
3030 session_key = context .get_session_key ()
3131 wrong_url = r"some/unexisting/url"
3232 rc = rest_client .SplunkRestClient (
@@ -40,6 +40,10 @@ def test_rest_client_user_agent():
4040 with pytest .raises (binding .HTTPError ):
4141 rc .get (wrong_url )
4242
43- search_results = search (session_key , test_url )
44- assert len (search_results ) == 1
43+ for i in range (50 ):
44+ search_results = search (session_key , test_url )
45+ if len (search_results ) > 0 :
46+ break
47+ sleep (0.5 )
48+
4549 assert user_agent in search_results [0 ]["_raw" ]
You can’t perform that action at this time.
0 commit comments