Skip to content

Commit 81d06a0

Browse files
committed
Test StickyEndSeq.slice_seq()
1 parent d3f0772 commit 81d06a0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_fragments/test_fragments.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ def test_StickyEndSeq():
2929
)
3030
assert sticky.__repr__() == "(ATCG(+)-aaaat(16)cgggg-ATCG(-))"
3131

32+
# Test slice_seq()
33+
sticky = StickyEndSeq(
34+
Seq("AAAATTTTCCCCGGGG"),
35+
left_end=StickyEnd("ATCG", strand=+1),
36+
right_end=StickyEnd("ATCG", strand=-1),
37+
)
38+
sliced_sticky = sticky.slice_seq(start=0, end=4)
39+
assert sliced_sticky.__repr__() == "(None-AAAA-None)"
40+
41+
sliced_sticky = sticky.slice_seq(start=12)
42+
assert sliced_sticky.__repr__() == "(None-GGGG-None)"
43+
44+
sliced_sticky = sticky.slice_seq(end=12)
45+
assert sliced_sticky.__repr__() == "(None-AAAATTTTCCCC-None)"
46+
3247

3348
def test_StickyEndSeqFragment():
3449
sticky = StickyEndSeq(

0 commit comments

Comments
 (0)