view test/test_report.py @ 13:bbf9ab2ebee7 draft default tip

planemo upload for repository https://github.com/COMBAT-TB/confil commit fcda5ac2013e3253d68cb6db06acf3b5450dcd0c
author sanbi-uwc
date Tue, 12 Mar 2019 09:16:35 -0400
parents 5ec97cccb3fe
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)
        parse_report(TEST_REPORT, 20)