-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
123 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pathlib | ||
import pytest | ||
|
||
from click.testing import CliRunner | ||
|
||
from gbintk.cli import graphbin | ||
|
||
|
||
__author__ = "Vijini Mallawaarachchi" | ||
__credits__ = ["Vijini Mallawaarachchi"] | ||
|
||
|
||
DATADIR = pathlib.Path(__file__).parent / "data" | ||
|
||
@pytest.fixture(scope="session") | ||
def tmp_dir(tmpdir_factory): | ||
return tmpdir_factory.mktemp("tmp") | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def workingdir(tmp_dir, monkeypatch): | ||
"""set the working directory for all tests""" | ||
monkeypatch.chdir(tmp_dir) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def runner(): | ||
"""exportrc works correctly.""" | ||
return CliRunner() | ||
|
||
|
||
def test_graphbin_run(runner, tmp_dir): | ||
outpath = tmp_dir | ||
graph = DATADIR / "ESC_metaSPAdes" / "assembly_graph_with_scaffolds.gfa" | ||
contigs = DATADIR / "ESC_metaSPAdes" / "contigs.fasta" | ||
paths = DATADIR / "ESC_metaSPAdes" / "contigs.paths" | ||
binned = DATADIR / "ESC_metaSPAdes" / "initial_binning_res.csv" | ||
args = f"--assembler spades --graph {graph} --contigs {contigs} --paths {paths} --binned {binned} --output {outpath}".split() | ||
r = runner.invoke(graphbin, args, catch_exceptions=False) | ||
assert r.exit_code == 0, r.output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import pathlib | ||
import pytest | ||
|
||
from click.testing import CliRunner | ||
|
||
from gbintk.cli import graphbin2 | ||
|
||
|
||
__author__ = "Vijini Mallawaarachchi" | ||
__credits__ = ["Vijini Mallawaarachchi"] | ||
|
||
|
||
DATADIR = pathlib.Path(__file__).parent / "data" | ||
|
||
@pytest.fixture(scope="session") | ||
def tmp_dir(tmpdir_factory): | ||
return tmpdir_factory.mktemp("tmp") | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def workingdir(tmp_dir, monkeypatch): | ||
"""set the working directory for all tests""" | ||
monkeypatch.chdir(tmp_dir) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def runner(): | ||
"""exportrc works correctly.""" | ||
return CliRunner() | ||
|
||
|
||
def test_graphbin2_run(runner, tmp_dir): | ||
outpath = tmp_dir | ||
graph = DATADIR / "Sim-5G+metaSPAdes" / "assembly_graph_with_scaffolds.gfa" | ||
contigs = DATADIR / "Sim-5G+metaSPAdes" / "contigs.fasta" | ||
paths = DATADIR / "Sim-5G+metaSPAdes" / "contigs.paths" | ||
binned = DATADIR / "Sim-5G+metaSPAdes" / "initial_contig_bins.csv" | ||
abundance = DATADIR / "Sim-5G+metaSPAdes" / "abundance.abund" | ||
args = f"--assembler spades --graph {graph} --contigs {contigs} --paths {paths} --binned {binned} --abundance {abundance} --output {outpath}".split() | ||
r = runner.invoke(graphbin2, args, catch_exceptions=False) | ||
assert r.exit_code == 0, r.output | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pathlib | ||
import pytest | ||
|
||
from click.testing import CliRunner | ||
|
||
from gbintk.cli import metacoag | ||
|
||
|
||
__author__ = "Vijini Mallawaarachchi" | ||
__credits__ = ["Vijini Mallawaarachchi"] | ||
|
||
|
||
DATADIR = pathlib.Path(__file__).parent / "data" | ||
|
||
@pytest.fixture(scope="session") | ||
def tmp_dir(tmpdir_factory): | ||
return tmpdir_factory.mktemp("tmp") | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def workingdir(tmp_dir, monkeypatch): | ||
"""set the working directory for all tests""" | ||
monkeypatch.chdir(tmp_dir) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def runner(): | ||
"""exportrc works correctly.""" | ||
return CliRunner() | ||
|
||
|
||
def test_metacoag_run(runner, tmp_dir): | ||
outpath = tmp_dir | ||
graph = DATADIR / "Sim-5G+metaSPAdes" / "assembly_graph_with_scaffolds.gfa" | ||
contigs = DATADIR / "Sim-5G+metaSPAdes" / "contigs.fasta" | ||
paths = DATADIR / "Sim-5G+metaSPAdes" / "contigs.paths" | ||
abundance = DATADIR / "Sim-5G+metaSPAdes" / "coverm_mean_coverage.tsv" | ||
args = f"--assembler spades --graph {graph} --contigs {contigs} --paths {paths} --abundance {abundance} --output {outpath}".split() | ||
r = runner.invoke(metacoag, args, catch_exceptions=False) | ||
assert r.exit_code == 0, r.output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters