from pathlib import Path


def default_get_seed_from_coverage_file(coverage_filepath: Path) -> Path:
    """Find a seed based on the coverage file's path.

    This example assumes a directory containing testcases is in the same parent
    directory as the coverage dir and that they are named the same except for
    a suffix of "-cov" for the coverage dir and a suffix of ".cov" for the
    coverage file (this is bncov's default naming scheme)."""

    coverage_dir = coverage_filepath.parent
    seed_dir = coverage_dir.parent / coverage_dir.name.replace("-cov", "")
    seed_path = seed_dir / coverage_filepath.stem
    return seed_path