def test_init_config_install(mocker, tmpdir):

    # Make a source directory with some files
    config_tmpdir = tmpdir.mkdir("config")
    mock_dir = Directory(str(config_tmpdir))

    mocker.patch('dtocean_app.UserDataDirectory', return_value=mock_dir)

    init_config(install=True)

    assert len(config_tmpdir.listdir()) == 3
def test_get_install_paths(mocker, tmpdir):

    # Make a source directory with some files
    config_tmpdir = tmpdir.mkdir("config")
    mock_dir = Directory(str(config_tmpdir))

    mocker.patch('dtocean_app.UserDataDirectory', return_value=mock_dir)

    init_config(install=True)

    mocker.patch('dtocean_app.configure.UserDataDirectory',
                 return_value=mock_dir)

    test_dict = get_install_paths()

    assert "man_user_path" in test_dict
def test_start_logging_user(mocker, tmpdir):

    # Make a source directory with some files
    config_tmpdir = tmpdir.mkdir("config")
    mock_dir = Directory(str(config_tmpdir))

    mocker.patch('dtocean_app.UserDataDirectory', return_value=mock_dir)

    init_config()

    mocker.patch('dtocean_app.ObjDirectory', return_value=None)

    start_logging()

    logdir = config_tmpdir.join("..", "logs")

    assert len(logdir.listdir()) == 1