File tree Expand file tree Collapse file tree 5 files changed +18
-14
lines changed Expand file tree Collapse file tree 5 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 2727def _build_credential_manager (
2828 realm : Optional [str ] = None ,
2929) -> credentials .CredentialManager :
30- session_key = credentials .get_session_key (
31- context .username ,
32- context .password ,
33- scheme = context .scheme ,
34- host = context .host ,
35- port = context .port ,
36- )
30+ session_key = context .get_session_key ()
3731 return credentials .CredentialManager (
3832 session_key ,
3933 context .app ,
Original file line number Diff line number Diff line change 2323sys .path .insert (0 , op .dirname (op .dirname (op .abspath (__file__ ))))
2424
2525
26- def test_hec_config ():
26+ def test_hec_config (monkeypatch ):
27+ context .mock_splunk (monkeypatch )
28+
2729 session_key = context .get_session_key ()
2830 config = hec_config .HECConfig (session_key )
2931 stanza = {
Original file line number Diff line number Diff line change 2525sys .path .insert (0 , op .dirname (op .dirname (op .abspath (__file__ ))))
2626
2727
28- def test_hec_event_writer ():
28+ def test_hec_event_writer (monkeypatch ):
29+ context .mock_splunk (monkeypatch )
30+
2931 session_key = context .get_session_key ()
3032
3133 ew = hew .HECEventWriter ("test" , session_key )
@@ -40,7 +42,9 @@ def test_hec_event_writer():
4042 ew .write_events ([e1 , e2 ])
4143
4244
43- def test_hec_event_writes_with_non_utf_8 ():
45+ def test_hec_event_writes_with_non_utf_8 (monkeypatch ):
46+ context .mock_splunk (monkeypatch )
47+
4448 # To test scenario listed in https://github.com/splunk/addonfactory-solutions-library-python/pull/112.
4549 test_name = "test_hec_event_writes_with_non_utf_8"
4650 session_key = context .get_session_key ()
Original file line number Diff line number Diff line change 2424sys .path .insert (0 , op .dirname (op .dirname (op .abspath (__file__ ))))
2525
2626
27- def test_time_parser ():
27+ def test_time_parser (monkeypatch ):
28+ context .mock_splunk (monkeypatch )
29+
2830 session_key = context .get_session_key ()
2931 tp = time_parser .TimeParser (session_key )
3032
Original file line number Diff line number Diff line change @@ -114,7 +114,9 @@ def test_app_capability_manager():
114114 assert not acm .capabilities_are_registered ()
115115
116116
117- def test_check_user_access ():
117+ def test_check_user_access (monkeypatch ):
118+ context .mock_splunk (monkeypatch )
119+
118120 session_key = context .get_session_key ()
119121 app_capabilities = {
120122 "object_type1" : {
@@ -179,10 +181,10 @@ def test_get_user_roles():
179181 )
180182
181183
182- def test_user_access ():
184+ def test_user_access (monkeypatch ):
183185 test_object_acl_manager ()
184186 test_app_capability_manager ()
185- test_check_user_access ()
187+ test_check_user_access (monkeypatch )
186188 test_get_current_username ()
187189 test_get_user_capabilities ()
188190 test_user_is_capable ()
You can’t perform that action at this time.
0 commit comments