Skip to content

Commit

Permalink
chore: add MyPy-specific type test
Browse files Browse the repository at this point in the history
  • Loading branch information
clintval committed Aug 2, 2024
1 parent 8556eb8 commit ee6ecb6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pybedlite/tests/test_overlap_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@ def test_construction_from_ucsc_other_contigs(contig: str) -> None:
assert Interval.from_ucsc(f"{contig}:101-200") == Interval(contig, 100, 200)


def test_that_overlap_detector_allows_generic_parameterization() -> None:
"""
Test that the overlap detector allows for generic parameterization.
"""
records = [BedRecord(chrom="chr1", start=1, end=2), BedRecord(chrom="chr1", start=4, end=5)]
detector: OverlapDetector[BedRecord] = OverlapDetector(records)
overlaps: List[BedRecord] = detector.get_overlaps(Interval("chr1", 1, 2))
assert overlaps == [BedRecord(chrom="chr1", start=1, end=2)]


def test_arbitrary_interval_types() -> None:
"""
Test that an overlap detector can receive different interval-like objects and query them too.
Expand Down

0 comments on commit ee6ecb6

Please sign in to comment.