Skip to content

Commit

Permalink
Add a test for #144
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshw5 authored Oct 14, 2018
1 parent b5873a3 commit b2f377a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_feature_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,18 @@ def test_issue_134_no_build_index(self):
""" Ensure that index file is not built when build_index=False. See mdshw5/pyfaidx#134.
"""
faidx = Faidx('data/genes.fasta', build_index=False)

@raises(FastaIndexingError)
def test_issue_144_no_defline(self):
""" Ensure that an exception is raised when a file contains no deflines. See mdshw5/pyfaidx#144.
"""
tmp_dir = mkdtemp()
try:
fasta_path = os.path.join(tmp_dir, 'issue_144.fasta')
# Write simple fasta file
with open(fasta_path, 'w') as fasta_out:
fasta_out.write("CTCCGGGCCCAT\nATAAAGCCTAAA\n")
faidx = Faidx(fasta_path)
finally:
shutil.rmtree(tmp_dir)

0 comments on commit b2f377a

Please sign in to comment.