Skip to content

Commit

Permalink
Initial tests for mdshw5#155
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshw5 authored Nov 21, 2019
1 parent 002b639 commit c456033
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_feature_bounds_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@
path = os.path.dirname(__file__)
os.chdir(path)

class TestFeatureZeroLength:
"""Tests for handling zero-length entries, added in #155"""
def setUp(self):
with open('data/zero_length.fasta', 'w') as fasta:
fasta.write(""">A
ATCG
>B
>C
>D
GTA
GC""")

def tearDown(self):
os.remove('data/zero_length.fasta')
os.remove('data/zero_length.fasta.fai')

def test_index_zero_length(self):
fasta = Fasta('data/zero_length.fasta')

def test_fetch_zero_length(self):
fasta = Fasta('data/zero_length.fasta')
b = fasta["B"]
assert str(b) == ''

class TestFeatureBoundsCheck:
def setUp(self):
pass
Expand Down

0 comments on commit c456033

Please sign in to comment.