From b25d4fe3f69a573447ef5ac097a223c5b1127083 Mon Sep 17 00:00:00 2001 From: jaegeral Date: Fri, 20 Sep 2024 08:57:45 +0000 Subject: [PATCH] fix links in tests for the new location --- end_to_end_tests/upload_test.py | 2 +- timesketch/lib/testlib.py | 2 +- timesketch/lib/utils_test.py | 18 ++++++------------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/end_to_end_tests/upload_test.py b/end_to_end_tests/upload_test.py index 3de7fc2da5..8f6a914c29 100755 --- a/end_to_end_tests/upload_test.py +++ b/end_to_end_tests/upload_test.py @@ -240,7 +240,7 @@ def test_datetime_out_of_normal_range_in_csv(self): name=f"datetime_out_of_normal_range_in_csv_{rand}" ) self.sketch = sketch - file_path = "/usr/local/src/timesketch/test_tools/test_events/validate_time_out_of_range.csv" # pylint: disable=line-too-long + file_path = "/usr/local/src/timesketch/tests/test_events/validate_time_out_of_range.csv" # pylint: disable=line-too-long self.import_timeline(file_path, index_name=rand, sketch=sketch) timeline = sketch.list_timelines()[0] # check that timeline was uploaded correctly diff --git a/timesketch/lib/testlib.py b/timesketch/lib/testlib.py index 22ce03d648..628f6b4e0d 100644 --- a/timesketch/lib/testlib.py +++ b/timesketch/lib/testlib.py @@ -79,7 +79,7 @@ class TestConfig(object): SIMILARITY_DATA_TYPES = [] SIGMA_RULES_FOLDERS = ["./data/sigma/rules/"] INTELLIGENCE_TAG_METADATA = "./data/intelligence_tag_metadata.yaml" - CONTEXT_LINKS_CONFIG_PATH = "./test_tools/test_events/mock_context_links.yaml" + CONTEXT_LINKS_CONFIG_PATH = "./tests/test_events/mock_context_links.yaml" LLM_PROVIDER = "test" DFIQ_ENABLED = False DATA_TYPES_PATH = "./test_data/nl2q/test_data_types.csv" diff --git a/timesketch/lib/utils_test.py b/timesketch/lib/utils_test.py index 751ee5297e..a6eeb068a8 100644 --- a/timesketch/lib/utils_test.py +++ b/timesketch/lib/utils_test.py @@ -191,7 +191,7 @@ def test_missing_timestamp_csv_file(self): self.assertDictEqual( next( read_and_validate_csv( - "test_tools/test_events/validate_date_events_missing_timestamp.csv" + "tests/test_events/validate_date_events_missing_timestamp.csv" ) ), expected_output, @@ -225,9 +225,7 @@ def test_timestamp_is_ISOformat(self): }, ] results = iter( - read_and_validate_csv( - "test_tools/test_events/validate_timestamp_conversion.csv" - ) + read_and_validate_csv("tests/test_events/validate_timestamp_conversion.csv") ) for output in expected_outputs: self.assertDictEqual(next(results), output) @@ -237,7 +235,7 @@ def test_missing_datetime_in_CSV(self): to get it from timestamp or fail""" results = iter( read_and_validate_csv( - "test_tools/test_events/validate_no_datetime_timestamps.csv" + "tests/test_events/validate_no_datetime_timestamps.csv" ) ) @@ -281,9 +279,7 @@ def test_time_datetime_valueerror(self): """ - results = iter( - read_and_validate_csv("test_tools/test_events/invalid_datetime.csv") - ) + results = iter(read_and_validate_csv("tests/test_events/invalid_datetime.csv")) results_list = [] for item in results: results_list.append(item) @@ -303,9 +299,7 @@ def test_datetime_out_of_normal_range_in_csv(self): https://github.com/google/timesketch/issues/1617 """ results = iter( - read_and_validate_csv( - "test_tools/test_events/validate_time_out_of_range.csv" - ) + read_and_validate_csv("tests/test_events/validate_time_out_of_range.csv") ) results_list = [] for item in results: @@ -319,7 +313,7 @@ def test_datetime_out_of_normal_range_in_csv(self): def test_time_precision_in_csv(self): """Test for parsing a file with time precision""" results = iter( - read_and_validate_csv("test_tools/test_events/validate_time_precision.csv") + read_and_validate_csv("tests/test_events/validate_time_precision.csv") ) results_list = [] for item in results: