Skip to content

Commit bdb8a1b

Browse files
fix: fix in assert log (#702)
* fix: fix in assert log * fix: update get_table_output usages Co-authored-by: mkolasinski-splunk <[email protected]>
1 parent edcf696 commit bdb8a1b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

events.pickle

58 Bytes
Binary file not shown.

pytest_splunk_addon/standard_lib/addon_basic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
"""
2121

2222
from .fields_tests import FieldTestTemplates
23-
from .cim_tests import CIMTestTemplates, FieldTestHelper
23+
from .cim_tests import CIMTestTemplates
2424
from .index_tests import IndexTimeTestTemplate
25+
from .utilities.log_helper import get_table_output
2526
import pytest
2627

2728

@@ -60,7 +61,7 @@ def test_events_with_untokenised_values(
6061
)
6162
if results:
6263
record_property("results", results)
63-
result_str = FieldTestHelper.get_table_output(
64+
result_str = get_table_output(
6465
headers=["Source", "Sourcetype"],
6566
value_list=[
6667
[

pytest_splunk_addon/standard_lib/index_tests/test_templates.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from math import ceil
2424
from ..cim_tests import FieldTestHelper
2525
from ..utilities.log_helper import format_search_query_log
26+
from ..utilities.log_helper import get_table_output
2627

2728
MAX_TIME_DIFFERENCE = 45
2829
LOGGER = logging.getLogger("pytest-splunk-addon")
@@ -145,7 +146,7 @@ def test_indextime_key_fields(
145146
missing_keys.append([each_field, fields_to_check[each_field]])
146147
final_str = ""
147148
if value_list:
148-
result_str = FieldTestHelper.get_table_output(
149+
result_str = get_table_output(
149150
headers=["Key_field", "Expected_values", "Actual_values"],
150151
value_list=[
151152
[
@@ -159,7 +160,7 @@ def test_indextime_key_fields(
159160
final_str += f"Some values for the following key fields are missing\n\n{result_str}"
160161

161162
if missing_keys:
162-
missing_keys_result_str = FieldTestHelper.get_table_output(
163+
missing_keys_result_str = get_table_output(
163164
headers=["Key_field", "Expected_values"],
164165
value_list=[
165166
[
@@ -309,6 +310,6 @@ def test_indextime_line_breaker(
309310
count_from_results = int(results[0].get("count"))
310311
LOGGER.debug("Resulting count:{}".format(count_from_results))
311312
assert count_from_results == expected_events_count, (
312-
f"{format_search_query_log(search)}"
313+
f"{format_search_query_log(query)}"
313314
f"\nExpected count: {expected_events_count} Actual Count: {count_from_results}"
314315
)

0 commit comments

Comments
 (0)