def tmp_bdb_root(mocker, tmp_path):
    """Set a temporary root directory for the BerkeleyDB minter hierarchy.

    By default, a BDB path resolved by the minter will reference a location in EZID's
    minter hierarchy, as configured in the EZID settings. Currently, `ezid/db/minters`.
    This fixture causes BDB paths to resolve to an empty tree under /tmp. Any minters
    created by the test are deleted when the test exits.

    Returns a pathlib2.Path referencing the root of the tree. The slash operator can be
    used for creating paths below the root. E.g., `tmp_bdb_root / 'b2345' / 'x1'`.
    """
    for dot_path in ('nog.bdb._get_bdb_root','impl.nog.bdb._get_bdb_root',):
        mocker.patch(
            dot_path, return_value=(tmp_path / 'minters').resolve(),
        )

    return tmp_path