From 0db25d8b60939a240744cb56fdaa530c272a57d4 Mon Sep 17 00:00:00 2001 From: Arjan Draisma Date: Tue, 16 Jul 2024 12:54:54 +0200 Subject: [PATCH] remove class --- tests/unit/genomics/test_runbigscape.py | 113 +++++++++++++----------- 1 file changed, 59 insertions(+), 54 deletions(-) diff --git a/tests/unit/genomics/test_runbigscape.py b/tests/unit/genomics/test_runbigscape.py index 3882928b..30833dc9 100644 --- a/tests/unit/genomics/test_runbigscape.py +++ b/tests/unit/genomics/test_runbigscape.py @@ -3,76 +3,81 @@ from .. import DATA_DIR -class TestRunBigscape: - def test_run_bigscape_v1(self, tmp_path): - result = bigscape.run_bigscape( - antismash_path=DATA_DIR, - output_path=tmp_path, - extra_params="--help", - version=1, - ) +def test_run_bigscape_v1(tmp_path): + result = bigscape.run_bigscape( + antismash_path=DATA_DIR, + output_path=tmp_path, + extra_params="--help", + version=1, + ) + + assert result is True + + +def test_run_bigscape_v2(tmp_path): + result = bigscape.run_bigscape( + antismash_path=DATA_DIR, + output_path=tmp_path, + extra_params="--help", + version=2, + ) + + assert result is True - assert result is True - def test_run_bigscape_v2(self, tmp_path): - result = bigscape.run_bigscape( +def test_run_bigscape_small_dataset_v1(tmp_path): + result = bigscape.run_bigscape( + antismash_path=DATA_DIR / "bigscape/minimal_dataset", + output_path=tmp_path, + extra_params="", + version=1, + ) + + assert result is True + + +def test_run_bigscape_small_dataset_v2(tmp_path): + result = bigscape.run_bigscape( + antismash_path=DATA_DIR / "bigscape/minimal_dataset", + output_path=tmp_path, + extra_params="", + version=2, + ) + + assert result is True + + +def test_run_bigscape_wrong_version(tmp_path): + with pytest.raises(ValueError) as e: + bigscape.run_bigscape( antismash_path=DATA_DIR, output_path=tmp_path, extra_params="--help", - version=2, + version=3, ) - assert result is True + assert "version" in e.value.args[0] - def test_run_bigscape_small_dataset_v1(self, tmp_path): - result = bigscape.run_bigscape( - antismash_path=DATA_DIR / "bigscape/minimal_dataset", + +def test_input_path_not_exist_v1(tmp_path): + with pytest.raises(FileNotFoundError) as e: + bigscape.run_bigscape( + antismash_path=tmp_path / "not_exist", output_path=tmp_path, extra_params="", version=1, ) - assert result is True + assert "antismash_path" in e.value.args[0] + - def test_run_bigscape_small_dataset_v2(self, tmp_path): - result = bigscape.run_bigscape( - antismash_path=DATA_DIR / "bigscape/minimal_dataset", +def test_input_path_not_exist_v2(tmp_path): + with pytest.raises(FileNotFoundError) as e: + bigscape.run_bigscape( + antismash_path=tmp_path / "not_exist", output_path=tmp_path, extra_params="", version=2, ) - assert result is True - - def test_run_bigscape_wrong_version(self, tmp_path): - with pytest.raises(ValueError) as e: - bigscape.run_bigscape( - antismash_path=DATA_DIR, - output_path=tmp_path, - extra_params="--help", - version=3, - ) - - assert "version" in e.value.args[0] - - def test_input_path_not_exist_v1(self, tmp_path): - with pytest.raises(FileNotFoundError) as e: - bigscape.run_bigscape( - antismash_path=tmp_path / "not_exist", - output_path=tmp_path, - extra_params="", - version=1, - ) - - assert "antismash_path" in e.value.args[0] - - def test_input_path_not_exist_v2(self, tmp_path): - with pytest.raises(FileNotFoundError) as e: - bigscape.run_bigscape( - antismash_path=tmp_path / "not_exist", - output_path=tmp_path, - extra_params="", - version=2, - ) - - assert "antismash_path" in e.value.args[0] + assert "antismash_path" in e.value.args[0]