Skip to content

Commit

Permalink
refactor(tests): update auto plotting test cases
Browse files Browse the repository at this point in the history
- Modified `tests/auto/test_auto_plotting.py` for improved readability
- Refactored test cases to ensure better coverage and maintainability
- Updated test assertions to reflect recent changes in plotting logic
  • Loading branch information
psmyth94 committed Nov 22, 2024
1 parent bc741b7 commit 4583bb5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/auto/test_auto_plotting.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import unittest
from unittest.mock import MagicMock

from biofit.auto.processing_auto import AutoPreprocessor
import biofit.config
import pandas as pd
import pytest
from biocore.data_handling import DataHandler
from biofit.auto.configuration_auto import AutoPlotterConfig, AutoPreprocessorConfig
from biofit.auto.plotting_auto import AutoPlotter, PlotterPipeline
from biofit.auto.processing_auto import AutoPreprocessor
from biofit.processing import BaseProcessor, ProcessorConfig
from biofit.visualization.plotting import BasePlotter, PlotterConfig

Expand Down Expand Up @@ -80,7 +80,7 @@ class MockPlotter2Config(PlotterConfig):


class MockPlotterConfigForMockExperiment(MockPlotterConfig):
dataset_name = "mock_dataset"
experiment_name = "mock_dataset"
custom_param = "test_value3"


Expand Down Expand Up @@ -308,9 +308,9 @@ def test_for_dataset(self):

def test_loading_with_kwargs_overwriting_default(self):
# Arrange
dataset_name = "otu"
experiment_name = "otu"
plotter_pipeline = AutoPlotter.for_experiment(
dataset_name, custom_param="overwritten_value"
experiment_name, custom_param="overwritten_value"
)

# Assert
Expand All @@ -321,7 +321,7 @@ def test_loading_with_kwargs_overwriting_default(self):
def test_from_processor(self):
# Arrange
processor_mock = MagicMock(spec=BaseProcessor)
processor_mock.config.dataset_name = "test_dataset"
processor_mock.config.experiment_name = "test_dataset"
config_mock = MagicMock(spec=AutoPlotterConfig)
AutoPlotterConfig.for_processor = MagicMock(return_value=config_mock)
lazy_auto_mapping_mock = {MockPlotter: MockPlotter(config_mock)}
Expand Down

0 comments on commit 4583bb5

Please sign in to comment.