def test_get_model_path():
    runner = PipelineRunner()

    model = BenchmarkModel()
    dataset = BenchmarkDataset()
    path = runner.get_model_path(model=model, dataset=dataset)
    assert path
    assert model.version in path.stem
    assert dataset.version in path.stem
def test_pipeline_runner_run_calls(tiny_files_structure, sample_ids):
    runner = PipelineRunner(file_structure=tiny_files_structure, )
    runner.ds_builder = Mock(spec=DatasetBuilder)
    runner.model_trainer = Mock(spec=ModelTrainer)

    runner.get_model_path = Mock(spec=runner.get_model_path)
    runner.build_datasets = Mock(spec=runner.build_datasets,
                                 return_value=(0, 0, 0, 0))
    runner.splitter.split = Mock(spec=runner.splitter.split,
                                 return_value=(0, 0))
    runner.evaluate_validation_set = Mock(spec=runner.evaluate_validation_set)
    runner.run_pipeline(
        sample_ids,
        dataset=BenchmarkDataset(),
        model=BenchmarkModel(),
    )

    runner.splitter.split.assert_called_once_with(sample_ids, 0.2)
    runner.build_datasets.assert_called_once()
    runner.get_model_path.assert_called_once()
    runner.model_trainer.train_model.assert_called_once()
    runner.evaluate_validation_set.assert_called_once()