Skip to content

Commit

Permalink
Add tests from mdshw5#93 before merging mdshw5#155
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshw5 authored Nov 21, 2019
1 parent c456033 commit 9088dd1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_feature_bounds_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,28 @@ def test_fetch_zero_length(self):
fasta = Fasta('data/zero_length.fasta')
b = fasta["B"]
assert str(b) == ''

class TestZeroLengthSequenceSubRange(TestCase):
def setUp(self):
pass

def tearDown(self):
try:
os.remove('data/genes.fasta.fai')
except EnvironmentError:
pass # some tests may delete this file

def test_as_raw_zero_length_subsequence(self):
fasta = Fasta('data/genes.fasta', as_raw=True, strict_bounds=True)
expect = ''
result = fasta['gi|557361099|gb|KF435150.1|'][100:100]
assert result == expect

def test_zero_length_subsequence(self):
fasta = Fasta('data/genes.fasta', strict_bounds=True)
expect = ''
result = fasta['gi|557361099|gb|KF435150.1|'][100:100]
assert result.seq == expect

class TestFeatureBoundsCheck:
def setUp(self):
Expand Down

0 comments on commit 9088dd1

Please sign in to comment.