コード例 #1
0
ファイル: test_tracking.py プロジェクト: acroz/mlflow-faculty
def test_restore_experiment_invalid_experiment_id(mocker):
    mocker.patch("faculty.client")

    store = FacultyRestStore(STORE_URI)

    with pytest.raises(ValueError):
        store.restore_experiment("invalid-experiment-id")
コード例 #2
0
ファイル: test_tracking.py プロジェクト: acroz/mlflow-faculty
def test_restore_experiment(mocker):
    mock_client = mocker.Mock()
    mocker.patch("faculty.client", return_value=mock_client)

    store = FacultyRestStore(STORE_URI)
    store.restore_experiment(EXPERIMENT_ID)

    mock_client.restore.assert_called_once_with(PROJECT_ID, EXPERIMENT_ID)
コード例 #3
0
ファイル: test_tracking.py プロジェクト: acroz/mlflow-faculty
def test_restore_experiment_client_error(mocker):
    mock_client = mocker.Mock()
    mock_client.restore.side_effect = HttpError(
        mocker.Mock(), "Experiment with ID _ not found in project _")
    mocker.patch("faculty.client", return_value=mock_client)

    store = FacultyRestStore(STORE_URI)

    with pytest.raises(MlflowException,
                       match="Experiment with ID _ not found in project _"):
        store.restore_experiment(EXPERIMENT_ID)

    mock_client.restore.assert_called_once_with(PROJECT_ID, EXPERIMENT_ID)