def test_plot(report, mock_model, iterations_train, iterations_test, iterations_delta): with patch.object(BaseVolatilityEstimator, 'compute', return_value=report.loc[['roc_auc']]) as mock_compute: with patch.object(BaseVolatilityEstimator, '_get_samples_to_plot', return_value=(iterations_train, iterations_test, iterations_delta)) as mock_get_samples: vol = BaseVolatilityEstimator(mock_model) vol.fitted = True vol.plot(metrics='roc_auc') mock_compute.assert_called_with(metrics='roc_auc') mock_get_samples.assert_called_with(metric_name='roc_auc')
def test_plot(report, mock_model, iterations_train, iterations_test, iterations_delta): """ Test. """ with patch.object(BaseVolatilityEstimator, "compute", return_value=report.loc[["roc_auc"]]) as mock_compute: with patch.object( BaseVolatilityEstimator, "_get_samples_to_plot", return_value=(iterations_train, iterations_test, iterations_delta), ) as mock_get_samples: vol = BaseVolatilityEstimator(mock_model) vol.fitted = True vol.plot(metrics="roc_auc") mock_compute.assert_called_with(metrics="roc_auc") mock_get_samples.assert_called_with(metric_name="roc_auc")