Skip to content

Commit bbdeab8

Browse files
committed
fix tests
1 parent ed7116f commit bbdeab8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/unit/test_unit.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from unittest.mock import patch
77
from utils import process_and_return_exclusions, is_json, add_lines, rgignore_cleanup
88
from utils import get_batch_info, truncate_line, get_source_type, open_csv, get_colors
9-
from utils import write_file, grab_repo_name, get_hannibal_hec_info, TimeFunction, BiasedLanguageLogger
9+
from utils import write_file, grab_repo_name, get_hec_info, TimeFunction, BiasedLanguageLogger
1010
from utils import get_line_count
1111
from run_json import main, rg_search, build_args_dict, process_word_occurrences, process_biased_word_line
1212
from tools.event2splunk import Event2Splunk
@@ -115,7 +115,7 @@ def test_build_args_dict():
115115
assert args['path'] == mock_repo_path
116116
assert args['mode'] == 'check'
117117
assert args['err_file'] == constants.ERR_FILE
118-
assert len(args) == 10
118+
assert len(args) == 12
119119

120120

121121
def test_process_word_occurrences(batch_info):
@@ -183,14 +183,14 @@ def test_exclusions_if_no_exclude_file():
183183

184184
def test_get_splunk_hec_info():
185185
with pytest.raises(Exception) as no_hec:
186-
get_hannibal_hec_info(None)
187-
assert "No Splunk HEC token provided" in str(no_hec.value)
186+
get_hec_info(None, None)
187+
assert "Missing Splunk HEC token" in str(no_hec.value)
188188

189189

190190
def test_event2splunk(mocker):
191191
logger = BiasedLanguageLogger(
192192
name='UnitTesting', filename='UnitTesting.log')
193-
hec = get_hannibal_hec_info('valid-token')
193+
hec = get_hec_info('valid-token', 'https://fakeurl.com:1234')
194194
event2splunk = Event2Splunk(hec, logger)
195195
mocker.patch('tools.event2splunk.Event2Splunk._send_batch')
196196
event2splunk.post_event(payload={}, source='testing', sourcetype='testing')
@@ -237,7 +237,9 @@ def test_main(mock_post_event, mock_close_event):
237237
'splunk_flag': True,
238238
'enable_logs': False,
239239
'err_file': constants.ERR_FILE,
240+
'h_endpoint': 'valid-endpoint:1234',
240241
'splunk_token': 'valid-token',
242+
'pz_endpoint': 'valid-endpoint:1234',
241243
'pzero_token': 'valid-token',
242244
'github_repo': None
243245
}

0 commit comments

Comments
 (0)