-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from metagenomics/feature/test-create_overview.py
tests added for create overview.py
- Loading branch information
Showing
3 changed files
with
26 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
|
||
__author__ = 'pbelmann' | ||
|
||
import nose.tools as nose | ||
import tempfile | ||
from scripts import create_overview | ||
|
||
OVERVIEW_HEADER = [ | ||
'cov1\tcov2\tGene ID\tHMM\tClass\tscore HMM\tEvalue HMM\tBest blastp hit\tEvalue best blastp\tIdentity\tSubject accsession\tSubject titles\tSubject tax ids\tSubject ids\tLinks\tGene sequence\n'] | ||
|
||
|
||
def test_determine_class(): | ||
clazz = create_overview.determine_class("(Bla)CARB") | ||
nose.assert_equal(clazz, "A") | ||
|
||
|
||
def test_write_header(): | ||
coverages = ["cov1", "cov2"] | ||
_, path = tempfile.mkstemp() | ||
with open(path, "r+") as temp_file: | ||
create_overview.writeHeader(coverages, temp_file) | ||
temp_file.seek(0) | ||
nose.assert_equals(temp_file.readlines(), OVERVIEW_HEADER) | ||
os.remove(path) |