diff test/test_report.py @ 3:53a61865e86e draft

planemo upload for repository https://github.com/COMBAT-TB/confil commit cb48efaef286f70c94607cb583a61bb9e3d71604
author sanbi-uwc
date Wed, 27 Feb 2019 06:20:05 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/test_report.py	Wed Feb 27 06:20:05 2019 -0500
@@ -0,0 +1,24 @@
+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)