diff --git a/CHANGELOG.md b/CHANGELOG.md index d30170423..85cf456b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ ### Improvements +* rename `logprep.event_generator` module to `logprep.generator` + ### Bugfix * fixes exposing OpenSearch/ElasticSearch stacktraces in log when errors happen diff --git a/logprep/event_generator/__init__.py b/logprep/generator/__init__.py similarity index 100% rename from logprep/event_generator/__init__.py rename to logprep/generator/__init__.py diff --git a/logprep/event_generator/http/__init__.py b/logprep/generator/http/__init__.py similarity index 100% rename from logprep/event_generator/http/__init__.py rename to logprep/generator/http/__init__.py diff --git a/logprep/event_generator/http/controller.py b/logprep/generator/http/controller.py similarity index 94% rename from logprep/event_generator/http/controller.py rename to logprep/generator/http/controller.py index 6ad528e18..b2ef292a9 100644 --- a/logprep/event_generator/http/controller.py +++ b/logprep/generator/http/controller.py @@ -10,9 +10,9 @@ from concurrent.futures import ThreadPoolExecutor from logging import Logger -from logprep.event_generator.http.input import Input -from logprep.event_generator.http.output import Output -from logprep.event_generator.http.reporter import Reporter +from logprep.generator.http.input import Input +from logprep.generator.http.output import Output +from logprep.generator.http.reporter import Reporter class Controller: diff --git a/logprep/event_generator/http/input.py b/logprep/generator/http/input.py similarity index 99% rename from logprep/event_generator/http/input.py rename to logprep/generator/http/input.py index a27552d98..c87be43ad 100644 --- a/logprep/event_generator/http/input.py +++ b/logprep/generator/http/input.py @@ -16,7 +16,7 @@ import yaml from attr import define, field, validators -from logprep.event_generator.http.manipulator import Manipulator +from logprep.generator.http.manipulator import Manipulator @define(kw_only=True) diff --git a/logprep/event_generator/http/manipulator.py b/logprep/generator/http/manipulator.py similarity index 97% rename from logprep/event_generator/http/manipulator.py rename to logprep/generator/http/manipulator.py index 78b9c8734..b762c748e 100644 --- a/logprep/event_generator/http/manipulator.py +++ b/logprep/generator/http/manipulator.py @@ -10,7 +10,7 @@ from typing import TYPE_CHECKING, List if TYPE_CHECKING: - from logprep.event_generator.http.input import EventClassConfig + from logprep.generator.http.input import EventClassConfig class Manipulator: diff --git a/logprep/event_generator/http/output.py b/logprep/generator/http/output.py similarity index 100% rename from logprep/event_generator/http/output.py rename to logprep/generator/http/output.py diff --git a/logprep/event_generator/http/reporter.py b/logprep/generator/http/reporter.py similarity index 100% rename from logprep/event_generator/http/reporter.py rename to logprep/generator/http/reporter.py diff --git a/logprep/event_generator/kafka/__init__.py b/logprep/generator/kafka/__init__.py similarity index 100% rename from logprep/event_generator/kafka/__init__.py rename to logprep/generator/kafka/__init__.py diff --git a/logprep/event_generator/kafka/configuration.py b/logprep/generator/kafka/configuration.py similarity index 100% rename from logprep/event_generator/kafka/configuration.py rename to logprep/generator/kafka/configuration.py diff --git a/logprep/event_generator/kafka/document_loader.py b/logprep/generator/kafka/document_loader.py similarity index 95% rename from logprep/event_generator/kafka/document_loader.py rename to logprep/generator/kafka/document_loader.py index bd717ec89..743c3eece 100644 --- a/logprep/event_generator/kafka/document_loader.py +++ b/logprep/generator/kafka/document_loader.py @@ -6,8 +6,8 @@ import ndjson -from logprep.event_generator.kafka.configuration import Configuration -from logprep.event_generator.kafka.kafka_connector import KafkaConsumer +from logprep.generator.kafka.configuration import Configuration +from logprep.generator.kafka.kafka_connector import KafkaConsumer class DocumentLoader: diff --git a/logprep/event_generator/kafka/document_sender.py b/logprep/generator/kafka/document_sender.py similarity index 93% rename from logprep/event_generator/kafka/document_sender.py rename to logprep/generator/kafka/document_sender.py index d9c6272a9..cd2afe298 100644 --- a/logprep/event_generator/kafka/document_sender.py +++ b/logprep/generator/kafka/document_sender.py @@ -5,8 +5,8 @@ from time import perf_counter from uuid import uuid4 -from logprep.event_generator.kafka.configuration import Configuration -from logprep.event_generator.kafka.kafka_connector import KafkaProducer +from logprep.generator.kafka.configuration import Configuration +from logprep.generator.kafka.kafka_connector import KafkaProducer class DocumentSender: diff --git a/logprep/event_generator/kafka/kafka_connector.py b/logprep/generator/kafka/kafka_connector.py similarity index 98% rename from logprep/event_generator/kafka/kafka_connector.py rename to logprep/generator/kafka/kafka_connector.py index ae125c514..db8702a8d 100644 --- a/logprep/event_generator/kafka/kafka_connector.py +++ b/logprep/generator/kafka/kafka_connector.py @@ -5,7 +5,7 @@ from confluent_kafka import Consumer, Producer -from logprep.event_generator.kafka.configuration import Kafka +from logprep.generator.kafka.configuration import Kafka class KafkaProducer: diff --git a/logprep/event_generator/kafka/logger.py b/logprep/generator/kafka/logger.py similarity index 100% rename from logprep/event_generator/kafka/logger.py rename to logprep/generator/kafka/logger.py diff --git a/logprep/event_generator/kafka/process_runner.py b/logprep/generator/kafka/process_runner.py similarity index 92% rename from logprep/event_generator/kafka/process_runner.py rename to logprep/generator/kafka/process_runner.py index 5db71f654..df220a33d 100644 --- a/logprep/event_generator/kafka/process_runner.py +++ b/logprep/generator/kafka/process_runner.py @@ -8,9 +8,9 @@ import numpy as np -from logprep.event_generator.kafka.configuration import Configuration -from logprep.event_generator.kafka.document_loader import DocumentLoader -from logprep.event_generator.kafka.document_sender import DocumentSender +from logprep.generator.kafka.configuration import Configuration +from logprep.generator.kafka.document_loader import DocumentLoader +from logprep.generator.kafka.document_sender import DocumentSender def get_record_cnt_for_process(config: Configuration, idx: int) -> int: diff --git a/logprep/event_generator/kafka/run_load_tester.py b/logprep/generator/kafka/run_load_tester.py similarity index 71% rename from logprep/event_generator/kafka/run_load_tester.py rename to logprep/generator/kafka/run_load_tester.py index 98818f4d6..ae28c20ed 100644 --- a/logprep/event_generator/kafka/run_load_tester.py +++ b/logprep/generator/kafka/run_load_tester.py @@ -3,10 +3,10 @@ from multiprocessing import Manager from pathlib import Path -from logprep.event_generator.kafka.configuration import load_config -from logprep.event_generator.kafka.logger import create_logger -from logprep.event_generator.kafka.process_runner import run_processes -from logprep.event_generator.kafka.util import print_results, print_startup_info +from logprep.generator.kafka.configuration import load_config +from logprep.generator.kafka.logger import create_logger +from logprep.generator.kafka.process_runner import run_processes +from logprep.generator.kafka.util import print_results, print_startup_info class LoadTester: diff --git a/logprep/event_generator/kafka/util.py b/logprep/generator/kafka/util.py similarity index 95% rename from logprep/event_generator/kafka/util.py rename to logprep/generator/kafka/util.py index 3b8ad9651..a5f5461ec 100644 --- a/logprep/event_generator/kafka/util.py +++ b/logprep/generator/kafka/util.py @@ -5,7 +5,7 @@ import numpy as np -from logprep.event_generator.kafka.configuration import Configuration +from logprep.generator.kafka.configuration import Configuration def get_avg_size_mb(source_file: Path) -> float: diff --git a/logprep/run_logprep.py b/logprep/run_logprep.py index 96a6795be..d67afdbe2 100644 --- a/logprep/run_logprep.py +++ b/logprep/run_logprep.py @@ -9,8 +9,8 @@ import click from colorama import Fore -from logprep.event_generator.http.controller import Controller -from logprep.event_generator.kafka.run_load_tester import LoadTester +from logprep.generator.http.controller import Controller +from logprep.generator.kafka.run_load_tester import LoadTester from logprep.runner import Runner from logprep.util import defaults from logprep.util.auto_rule_tester.auto_rule_corpus_tester import RuleCorpusTester diff --git a/tests/testdata/event_generator/kafka/config.yml b/tests/testdata/generator/kafka/config.yml similarity index 100% rename from tests/testdata/event_generator/kafka/config.yml rename to tests/testdata/generator/kafka/config.yml diff --git a/tests/testdata/event_generator/kafka/kafka_config_dict.py b/tests/testdata/generator/kafka/kafka_config_dict.py similarity index 87% rename from tests/testdata/event_generator/kafka/kafka_config_dict.py rename to tests/testdata/generator/kafka/kafka_config_dict.py index fc0796d76..6e514ad56 100644 --- a/tests/testdata/event_generator/kafka/kafka_config_dict.py +++ b/tests/testdata/generator/kafka/kafka_config_dict.py @@ -1,7 +1,7 @@ # pylint: disable=missing-module-docstring # pylint: disable=missing-class-docstring # pylint: disable=missing-function-docstring -from logprep.event_generator.kafka.configuration import validate +from logprep.generator.kafka.configuration import validate def get_config(): diff --git a/tests/testdata/event_generator/kafka/wineventlog_raw.jsonl b/tests/testdata/generator/kafka/wineventlog_raw.jsonl similarity index 100% rename from tests/testdata/event_generator/kafka/wineventlog_raw.jsonl rename to tests/testdata/generator/kafka/wineventlog_raw.jsonl diff --git a/tests/unit/event_generator/__init__.py b/tests/unit/generator/__init__.py similarity index 100% rename from tests/unit/event_generator/__init__.py rename to tests/unit/generator/__init__.py diff --git a/tests/unit/event_generator/http/__init__.py b/tests/unit/generator/http/__init__.py similarity index 100% rename from tests/unit/event_generator/http/__init__.py rename to tests/unit/generator/http/__init__.py diff --git a/tests/unit/event_generator/http/test_controller.py b/tests/unit/generator/http/test_controller.py similarity index 95% rename from tests/unit/event_generator/http/test_controller.py rename to tests/unit/generator/http/test_controller.py index b88fe760b..2bf028de2 100644 --- a/tests/unit/event_generator/http/test_controller.py +++ b/tests/unit/generator/http/test_controller.py @@ -7,8 +7,8 @@ import responses -from logprep.event_generator.http.controller import Controller -from tests.unit.event_generator.http.util import create_test_event_files +from logprep.generator.http.controller import Controller +from tests.unit.generator.http.util import create_test_event_files class TestController: @@ -90,7 +90,7 @@ def test_run(self, tmp_path): assert call.request.headers.get("Content-Type") == expected_http_header assert call.response.status_code == 200 - @mock.patch("logprep.event_generator.http.controller.ThreadPoolExecutor") + @mock.patch("logprep.generator.http.controller.ThreadPoolExecutor") def test_run_with_multiple_threads(self, mock_executor_class, tmp_path): self.contoller = Controller( input_dir="", diff --git a/tests/unit/event_generator/http/test_input.py b/tests/unit/generator/http/test_input.py similarity index 99% rename from tests/unit/event_generator/http/test_input.py rename to tests/unit/generator/http/test_input.py index 920364de3..cf148dd6b 100644 --- a/tests/unit/event_generator/http/test_input.py +++ b/tests/unit/generator/http/test_input.py @@ -10,8 +10,8 @@ import pytest import yaml -from logprep.event_generator.http.input import EventClassConfig, Input -from tests.unit.event_generator.http.util import create_test_event_files +from logprep.generator.http.input import EventClassConfig, Input +from tests.unit.generator.http.util import create_test_event_files class TestInput: diff --git a/tests/unit/event_generator/http/test_manipulator.py b/tests/unit/generator/http/test_manipulator.py similarity index 97% rename from tests/unit/event_generator/http/test_manipulator.py rename to tests/unit/generator/http/test_manipulator.py index 94cc9b298..2e57cc49b 100644 --- a/tests/unit/event_generator/http/test_manipulator.py +++ b/tests/unit/generator/http/test_manipulator.py @@ -4,8 +4,8 @@ import pytest -from logprep.event_generator.http.input import EventClassConfig -from logprep.event_generator.http.manipulator import Manipulator +from logprep.generator.http.input import EventClassConfig +from logprep.generator.http.manipulator import Manipulator @pytest.fixture(name="manipulator_with_timestamps") diff --git a/tests/unit/event_generator/http/test_output.py b/tests/unit/generator/http/test_output.py similarity index 96% rename from tests/unit/event_generator/http/test_output.py rename to tests/unit/generator/http/test_output.py index 5012606dd..401f19f4b 100644 --- a/tests/unit/event_generator/http/test_output.py +++ b/tests/unit/generator/http/test_output.py @@ -2,7 +2,7 @@ import pytest import responses -from logprep.event_generator.http.output import Output +from logprep.generator.http.output import Output TARGET_URL = "https://www.test.de" diff --git a/tests/unit/event_generator/http/test_reporter.py b/tests/unit/generator/http/test_reporter.py similarity index 97% rename from tests/unit/event_generator/http/test_reporter.py rename to tests/unit/generator/http/test_reporter.py index 9606f5c8c..649dae00c 100644 --- a/tests/unit/event_generator/http/test_reporter.py +++ b/tests/unit/generator/http/test_reporter.py @@ -10,7 +10,7 @@ import yaml from pandas import DatetimeIndex -from logprep.event_generator.http.reporter import Reporter +from logprep.generator.http.reporter import Reporter class TestReporter: @@ -95,7 +95,7 @@ def test__write_experiment_results__creates_a_report_on_disk__as_smoke_test(self ) # mock time to prevent a flipping test. If the time datapoints jump from one second the # next then the calculation for the "per second" metrics won't be as expected/accurate. - with mock.patch("logprep.event_generator.http.reporter.datetime") as mock_now: + with mock.patch("logprep.generator.http.reporter.datetime") as mock_now: for i in range(10): mock_now.datetime.now.return_value = datetime.datetime( year=2024, month=1, day=31, hour=9, minute=29, second=42, microsecond=i diff --git a/tests/unit/event_generator/http/util.py b/tests/unit/generator/http/util.py similarity index 100% rename from tests/unit/event_generator/http/util.py rename to tests/unit/generator/http/util.py diff --git a/tests/unit/event_generator/kafka/__init__.py b/tests/unit/generator/kafka/__init__.py similarity index 100% rename from tests/unit/event_generator/kafka/__init__.py rename to tests/unit/generator/kafka/__init__.py diff --git a/tests/unit/event_generator/kafka/test_configuration.py b/tests/unit/generator/kafka/test_configuration.py similarity index 75% rename from tests/unit/event_generator/kafka/test_configuration.py rename to tests/unit/generator/kafka/test_configuration.py index 60ad51ce3..91e4a8121 100644 --- a/tests/unit/event_generator/kafka/test_configuration.py +++ b/tests/unit/generator/kafka/test_configuration.py @@ -4,7 +4,7 @@ # pylint: disable=missing-function-docstring from pathlib import Path, PosixPath -from logprep.event_generator.kafka.configuration import ( +from logprep.generator.kafka.configuration import ( Configuration, Consumer, Kafka, @@ -14,7 +14,7 @@ EXPECTED_CONFIG = Configuration( # profile=False, - source_file=PosixPath("tests/testdata/event_generator/kafka/wineventlog_raw.jsonl"), + source_file=PosixPath("tests/testdata/generator/kafka/wineventlog_raw.jsonl"), count=400000, source_count=5, logging_level="DEBUG", @@ -38,13 +38,13 @@ class TestConfiguration: def test_load_configuration_with_source_file(self): config = load_config( - Path("tests/testdata/event_generator/kafka/config.yml"), - Path("tests/testdata/event_generator/kafka/wineventlog_raw.jsonl"), + Path("tests/testdata/generator/kafka/config.yml"), + Path("tests/testdata/generator/kafka/wineventlog_raw.jsonl"), ) assert config == EXPECTED_CONFIG def test_load_configuration_without_source_file(self): expected = EXPECTED_CONFIG.model_copy() expected.source_file = None - config = load_config(Path("tests/testdata/event_generator/kafka/config.yml")) + config = load_config(Path("tests/testdata/generator/kafka/config.yml")) assert config == expected diff --git a/tests/unit/event_generator/kafka/test_document_loader.py b/tests/unit/generator/kafka/test_document_loader.py similarity index 92% rename from tests/unit/event_generator/kafka/test_document_loader.py rename to tests/unit/generator/kafka/test_document_loader.py index 86f8a3f56..e3f2e04c9 100644 --- a/tests/unit/event_generator/kafka/test_document_loader.py +++ b/tests/unit/generator/kafka/test_document_loader.py @@ -10,11 +10,10 @@ from typing import List, Optional from unittest.mock import MagicMock, patch -from tests.testdata.event_generator.kafka.kafka_config_dict import get_config - -from logprep.event_generator.kafka.document_loader import DocumentLoader -from logprep.event_generator.kafka.kafka_connector import KafkaConsumer -from logprep.event_generator.kafka.logger import create_logger +from logprep.generator.kafka.document_loader import DocumentLoader +from logprep.generator.kafka.kafka_connector import KafkaConsumer +from logprep.generator.kafka.logger import create_logger +from tests.testdata.generator.kafka.kafka_config_dict import get_config class MockedRecord: @@ -49,9 +48,7 @@ def setup_method(self): logger = create_logger(config.logging_level) mocked_kafka = MagicMock() mocked_kafka.Consumer = MockedConsumer - with patch( - "logprep.event_generator.kafka.kafka_connector.Consumer", return_value=mocked_kafka - ): + with patch("logprep.generator.kafka.kafka_connector.Consumer", return_value=mocked_kafka): self._document_loader = DocumentLoader(config, logger) def test_init(self): @@ -61,14 +58,14 @@ def test_init(self): def test_get_from_file(self): self._document_loader._source_file = Path( - "tests/testdata/event_generator/kafka/wineventlog_raw.jsonl" + "tests/testdata/generator/kafka/wineventlog_raw.jsonl" ) documents = self._document_loader._get_from_file() assert len(documents) == 500 def test_get_raw_documents_from_file_if_source_file_set(self): self._document_loader._source_file = Path( - "tests/testdata/event_generator/kafka/wineventlog_raw.jsonl" + "tests/testdata/generator/kafka/wineventlog_raw.jsonl" ) documents = self._document_loader._get_raw_documents() assert len(documents) == 500 diff --git a/tests/unit/event_generator/kafka/test_document_sender.py b/tests/unit/generator/kafka/test_document_sender.py similarity index 81% rename from tests/unit/event_generator/kafka/test_document_sender.py rename to tests/unit/generator/kafka/test_document_sender.py index e0724d9c3..6fd9ade2f 100644 --- a/tests/unit/event_generator/kafka/test_document_sender.py +++ b/tests/unit/generator/kafka/test_document_sender.py @@ -8,10 +8,9 @@ from unittest import mock from unittest.mock import MagicMock, patch -from tests.testdata.event_generator.kafka.kafka_config_dict import get_config - -from logprep.event_generator.kafka.document_sender import DocumentSender -from logprep.event_generator.kafka.kafka_connector import KafkaProducer +from logprep.generator.kafka.document_sender import DocumentSender +from logprep.generator.kafka.kafka_connector import KafkaProducer +from tests.testdata.generator.kafka.kafka_config_dict import get_config class MockedProducer: @@ -30,15 +29,13 @@ class TestDocumentSender: def setup_method(self): mocked_kafka = MagicMock() mocked_kafka.Producer = MockedProducer - with patch( - "logprep.event_generator.kafka.kafka_connector.Producer", return_value=mocked_kafka - ): + with patch("logprep.generator.kafka.kafka_connector.Producer", return_value=mocked_kafka): self._document_sender = DocumentSender(get_config(), MagicMock()) def test_init(self): assert isinstance(self._document_sender._kafka_producer, KafkaProducer) - @mock.patch("logprep.event_generator.kafka.document_sender.perf_counter") + @mock.patch("logprep.generator.kafka.document_sender.perf_counter") def test_send_zero(self, time_mock): time_mock.return_value = 0 self._document_sender._kafka_producer._producer = MockedProducer() @@ -48,7 +45,7 @@ def test_send_zero(self, time_mock): assert count == 0 assert self._document_sender._kafka_producer._producer.produced == [] - @mock.patch("logprep.event_generator.kafka.document_sender.perf_counter") + @mock.patch("logprep.generator.kafka.document_sender.perf_counter") def test_send_one_of_zero(self, time_mock): time_mock.return_value = 0 self._document_sender._kafka_producer._producer = MockedProducer() @@ -56,7 +53,7 @@ def test_send_one_of_zero(self, time_mock): assert count == 0 assert self._document_sender._kafka_producer._producer.produced == [] - @mock.patch("logprep.event_generator.kafka.document_sender.perf_counter") + @mock.patch("logprep.generator.kafka.document_sender.perf_counter") def test_send_one(self, time_mock): time_mock.return_value = 0 self._document_sender._kafka_producer._producer = MockedProducer() @@ -67,7 +64,7 @@ def test_send_one(self, time_mock): self._assert_uuid4_was_added_and_remove_it() assert self._document_sender._kafka_producer._producer.produced == [{"foo": "1"}] - @mock.patch("logprep.event_generator.kafka.document_sender.perf_counter") + @mock.patch("logprep.generator.kafka.document_sender.perf_counter") def test_send_multiple(self, time_mock): time_mock.return_value = 0 self._document_sender._kafka_producer._producer = MockedProducer() @@ -81,7 +78,7 @@ def test_send_multiple(self, time_mock): {"bar": "2"}, ] - @mock.patch("logprep.event_generator.kafka.document_sender.perf_counter") + @mock.patch("logprep.generator.kafka.document_sender.perf_counter") def test_send_more_than_available(self, time_mock): time_mock.return_value = 0 self._document_sender._kafka_producer._producer = MockedProducer() diff --git a/tests/unit/event_generator/kafka/test_process_runner.py b/tests/unit/generator/kafka/test_process_runner.py similarity index 91% rename from tests/unit/event_generator/kafka/test_process_runner.py rename to tests/unit/generator/kafka/test_process_runner.py index f0abbb8d3..8bd19d1ee 100644 --- a/tests/unit/event_generator/kafka/test_process_runner.py +++ b/tests/unit/generator/kafka/test_process_runner.py @@ -6,7 +6,7 @@ import pytest from pydantic import BaseModel -from logprep.event_generator.kafka.process_runner import get_record_cnt_for_process +from logprep.generator.kafka.process_runner import get_record_cnt_for_process class ConfigurationTest(BaseModel): diff --git a/tests/unit/event_generator/kafka/test_util.py b/tests/unit/generator/kafka/test_util.py similarity index 64% rename from tests/unit/event_generator/kafka/test_util.py rename to tests/unit/generator/kafka/test_util.py index bc5ad67d2..31e81b305 100644 --- a/tests/unit/event_generator/kafka/test_util.py +++ b/tests/unit/generator/kafka/test_util.py @@ -5,8 +5,8 @@ from pathlib import Path from unittest.mock import MagicMock -from logprep.event_generator.kafka.configuration import load_config -from logprep.event_generator.kafka.util import ( +from logprep.generator.kafka.configuration import load_config +from logprep.generator.kafka.util import ( get_avg_size_mb, print_results, print_startup_info, @@ -16,14 +16,14 @@ class TestUtil: def test_get_avg_size_mb(self): assert ( - get_avg_size_mb(Path("tests/testdata/event_generator/kafka/wineventlog_raw.jsonl")) + get_avg_size_mb(Path("tests/testdata/generator/kafka/wineventlog_raw.jsonl")) == 0.001621 ) def test_print_results_with_empty_shared_dict(self): config = load_config( - Path("tests/testdata/event_generator/kafka/config.yml"), - Path("tests/testdata/event_generator/kafka/wineventlog_raw.jsonl"), + Path("tests/testdata/generator/kafka/config.yml"), + Path("tests/testdata/generator/kafka/wineventlog_raw.jsonl"), ) logger = MagicMock() print_results(config, logger, {}) @@ -31,8 +31,8 @@ def test_print_results_with_empty_shared_dict(self): def test_print_results_with_filled_shared_dict(self): config = load_config( - Path("tests/testdata/event_generator/kafka/config.yml"), - Path("tests/testdata/event_generator/kafka/wineventlog_raw.jsonl"), + Path("tests/testdata/generator/kafka/config.yml"), + Path("tests/testdata/generator/kafka/wineventlog_raw.jsonl"), ) logger = MagicMock() print_results(config, logger, {"foo_sent": 2, "bar_sent": 3, "foo_time": 4, "bar_time": 8}) @@ -40,8 +40,8 @@ def test_print_results_with_filled_shared_dict(self): def test_print_startup_info_with_source_file(self): config = load_config( - Path("tests/testdata/event_generator/kafka/config.yml"), - Path("tests/testdata/event_generator/kafka/wineventlog_raw.jsonl"), + Path("tests/testdata/generator/kafka/config.yml"), + Path("tests/testdata/generator/kafka/wineventlog_raw.jsonl"), ) logger = MagicMock() print_startup_info(config, logger) @@ -49,8 +49,8 @@ def test_print_startup_info_with_source_file(self): def test_print_startup_info_without_source_file(self): config = load_config( - Path("tests/testdata/event_generator/kafka/config.yml"), - Path("tests/testdata/event_generator/kafka/wineventlog_raw.jsonl"), + Path("tests/testdata/generator/kafka/config.yml"), + Path("tests/testdata/generator/kafka/wineventlog_raw.jsonl"), ) config.source_file = None logger = MagicMock() diff --git a/tests/unit/test_run_logprep.py b/tests/unit/test_run_logprep.py index 89ae7ce1c..94c73d5ef 100644 --- a/tests/unit/test_run_logprep.py +++ b/tests/unit/test_run_logprep.py @@ -287,7 +287,7 @@ def test_run_logprep_logs_log_level(self, mock_info): run_logprep.run(("tests/testdata/config/config.yml",)) mock_info.assert_has_calls([mock.call("Log level set to 'INFO'")]) - @mock.patch("logprep.event_generator.kafka.run_load_tester.LoadTester.run") + @mock.patch("logprep.generator.kafka.run_load_tester.LoadTester.run") def test_generate_kafka_starts_kafka_load_tester(self, mock_kafka_load_tester): tester_config = "some_config.yml" result = self.cli_runner.invoke(cli, ["generate", "kafka", tester_config])