Skip to content

Commit

Permalink
Test output of cmd_input_cmd function
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkc committed Dec 11, 2023
1 parent abbc069 commit d1e4fc8
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 44 deletions.
86 changes: 43 additions & 43 deletions tests/fixtures/ecoli/cdm_input.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
[
{
"software": "quast",
"version": null,
"result": {
"total_length": 5103744,
"reference_length": 4641652,
"largest_contig": 359420,
"n_contigs": 109,
"n50": 173071,
"assembly_gc": 50.81,
"reference_gc": 50.79,
"duplication_ratio": 1.001
}
},
{
"software": "postalignqc",
"version": null,
"result": {
"ins_size": 375,
"ins_size_dev": 328,
"mean_cov": 210,
"pct_above_x": {
"1": 99.8908335372424,
"500": 0.0,
"250": 8.28531811957226,
"10": 99.8664503084393,
"1000": 0.0,
"30": 99.8493219487695,
"100": 99.7996110703293
},
"mapped_reads": 6078594,
"tot_reads": 7579030,
"iqr_median": 0.19047619047619,
"dup_pct": 0.0,
"dup_reads": 0
}
},
{
"software": "chewbbaca",
"version": null,
"result": {
"n_missing": 4228
}
{
"software": "postalignqc",
"version": null,
"result": {
"ins_size": 375,
"ins_size_dev": 328,
"mean_cov": 210,
"pct_above_x": {
"1": 99.8908335372424,
"500": 0.0,
"250": 8.28531811957226,
"10": 99.8664503084393,
"1000": 0.0,
"30": 99.8493219487695,
"100": 99.7996110703293
},
"mapped_reads": 6078594,
"tot_reads": 7579030,
"iqr_median": 0.19047619047619,
"dup_pct": 0.0,
"dup_reads": 0
}
},
{
"software": "quast",
"version": null,
"result": {
"total_length": 5103744,
"reference_length": 4641652,
"largest_contig": 359420,
"n_contigs": 109,
"n50": 173071,
"assembly_gc": 50.81,
"reference_gc": 50.79,
"duplication_ratio": 1.001
}
},
{
"software": "chewbbaca",
"version": null,
"result": {
"n_missing": 4228
}
}
]
8 changes: 7 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test PRP cli functions."""

import json
from click.testing import CliRunner

from prp.cli import create_bonsai_input, create_cdm_input, print_schema
Expand Down Expand Up @@ -107,7 +108,7 @@ def test_create_output_ecoli(
assert result.exit_code == 0


def test_cdm_input_cmd(ecoli_quast_path, ecoli_bwa_path, ecoli_chewbbaca_path):
def test_cdm_input_cmd(ecoli_quast_path, ecoli_bwa_path, ecoli_chewbbaca_path, ecoli_cdm_input):
"""Test command for creating CDM input."""
runner = CliRunner()
with runner.isolated_filesystem():
Expand All @@ -127,3 +128,8 @@ def test_cdm_input_cmd(ecoli_quast_path, ecoli_bwa_path, ecoli_chewbbaca_path):

# test successful execution of command
assert result.exit_code == 0

# test correct output format
with open(output_fname) as inpt:
cmd_output = json.load(inpt)
assert cmd_output == ecoli_cdm_input

0 comments on commit d1e4fc8

Please sign in to comment.