view test/test_report.py @ 5:a7b05dd0087d draft

planemo upload for repository https://github.com/COMBAT-TB/confil commit 83c5a4f7379a73750c815756a4e84af8ecabe78b-dirty
author sanbi-uwc
date Mon, 04 Mar 2019 07:42:05 -0500
parents 53a61865e86e
children
line wrap: on
line source

import os

import pytest

from confil.report import parse_report
from test_runner import TEST_DATA_DIR

TEST_REPORT = os.path.join(TEST_DATA_DIR, "test_file.tab")

# test using a cutoff of 50%


@pytest.mark.parametrize("test_input, expected", [
    (type(parse_report(TEST_REPORT, 50)), list),
    (parse_report(TEST_REPORT, 50)[5], 'Mycobacterium'),
    (parse_report(TEST_REPORT, 50)[0], '55.84')
])
def test_parse_report(test_input, expected):
    assert test_input == expected


def test_parse_report_exception():
    with pytest.raises(SystemExit):
        parse_report(TEST_REPORT, 90)