Commit 36d0ebc8 authored by Georgios P. Katsikas's avatar Georgios P. Katsikas
Browse files

fix: analytics test

parent dca3cbef
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ from unittest.mock import MagicMock, patch
from .messages_analyzer import get_batch, get_input_kpi_list, get_output_kpi_list, get_thresholds, \
                               get_windows_size, get_batch_size, get_agg_df, get_duration

from common.tools.kafka.Variables                      import KafkaTopic
from analytics.backend.service.Streamer                import DaskStreamer
from analytics.backend.service.AnalyzerHandlers        import aggregation_handler, threshold_handler
from analytics.backend.service.AnalyticsBackendService import AnalyticsBackendService
@@ -261,7 +260,7 @@ def test_aggregation_handler():

    # Test aggregation_handler
    aggregated_df = aggregation_handler(
        "test_batch", "test_key", batch, input_kpi_list, output_kpi_list, thresholds
        "test_key", batch, input_kpi_list, output_kpi_list, thresholds
    )
    assert isinstance(aggregated_df, list)
    assert all(isinstance(item, dict) for item in aggregated_df)
@@ -276,7 +275,7 @@ def test_threshold_handler():
    result = threshold_handler("test_key", agg_df, thresholds["task_parameter"][0])

    assert isinstance(result, pd.DataFrame)
    assert result.shape == (1, 7)
    assert result.shape == (1, 5)


###########################