def test_edit_custom_examples_informs_if_no_custom_dir(
    mock_call,
    mock_get_paths,
    mock_get_program,
    mock_inform,
    mock_exists,
):
    """
    We should inform the user if they are trying to edit with no custom dir.

    This should be true if it is not set and if the path does not exist.
    """
    program = 'awk'

    # First with no custom dir set.
    config = _create_config(editor_cmd='vi -e')
    mock_exists.return_value = True
    util.edit_custom_examples(program, config)
    assert mock_inform.call_count == 1

    # And now with it set but a nonexistent path.
    config = _create_config(custom_dir='/path/to/custom', editor_cmd='vi -e')
    mock_exists.return_value = False
    util.edit_custom_examples(program, config)
    assert mock_inform.call_count == 2

    assert mock_call.call_count == 0
    assert mock_get_paths.call_count == 0
    assert mock_get_program.call_count == 0

    We should inform the user if they are trying to edit with no custom dir.

    This should be true if it is not set and if the path does not exist.
    
test/util_test.py