Skip to content

Commit

Permalink
Merge pull request #42 from metagenomics/feature/test-create_overview.py
Browse files Browse the repository at this point in the history
tests added for create overview.py
  • Loading branch information
pbelmann committed Aug 31, 2015
2 parents 2c7d6e8 + 79c2e72 commit f083cb8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ vendor/virtualenv:
mkdir -p vendor/virtualenv
git clone https://github.com/pypa/virtualenv.git $@

test = $(path) nosetests --rednose
test = $(path) nosetests -s --rednose

test:
@$(test)
Expand Down
8 changes: 0 additions & 8 deletions test/test_createOverview.py

This file was deleted.

25 changes: 25 additions & 0 deletions test/test_create_overview.py
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)

0 comments on commit f083cb8

Please sign in to comment.