def METHOD_NAME(mocker, tmpdir, caplog) -> None:
    sp_mock = mocker.patch('subprocess.check_output')
    path = Path(tmpdir / 'bar')
    assert not path.is_dir()
    x = create_userdata_dir(str(path), create_dir=True)
    assert sp_mock.call_count == 0
    assert log_has(f'Created user-data directory: {path}', caplog)
    assert isinstance(x, Path)
    assert path.is_dir()
    assert (path / 'data').is_dir()
    os.environ['FT_APP_ENV'] = 'docker'
    chown_user_directory(path / 'data')
    assert sp_mock.call_count == 1
    del os.environ['FT_APP_ENV']