Skip to content

Commit

Permalink
document tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yfarjoun committed Oct 21, 2024
1 parent 367497d commit b90b605
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/fgpyo/sam/test_cigar.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def test_bad_index_raises_type_error(index: int) -> None:
],
)
def test_query_alignment_offsets(cigar_string: str, expected_range: Tuple[int, int]) -> None:
"""
cig.query_alignment_offsets() should return the expected results.
"""
cig = Cigar.from_cigarstring(cigar_string)
ret = cig.query_alignment_offsets()
assert ret == expected_range
Expand All @@ -70,6 +73,7 @@ def test_query_alignment_offsets(cigar_string: str, expected_range: Tuple[int, i
],
)
def test_query_alignment_offsets_failures(cigar_string: str) -> None:
"""query_alignment_offsets() should raise a ValueError if the CIGAR has no aligned positions."""
cig = Cigar.from_cigarstring(cigar_string)
with pytest.raises(ValueError):
cig.query_alignment_offsets()
Expand All @@ -96,6 +100,10 @@ def test_query_alignment_offsets_failures(cigar_string: str) -> None:
def test_query_alignment_offsets_reversed(
cigar_string: str, expected_range: Tuple[int, int]
) -> None:
"""
cig.revered().query_alignment_offsets() should return the expected results.
"""

cig = Cigar.from_cigarstring(cigar_string)

ret = cig.reversed().query_alignment_offsets()
Expand Down

0 comments on commit b90b605

Please sign in to comment.