def METHOD_NAME(process_env, wsgi_env, fake_dir, expected):
    with mock.patch("pycsw.wsgi.os", autospec=True) as mock_os:
        mock_os.path.dirname.return_value = fake_dir
        result = wsgi.get_pycsw_root_path(
            process_env,
            request_environment=wsgi_env
        )
        assert result == expected