Skip to content

Commit a54dcc6

Browse files
committed
Add png plot test case
1 parent fa9808c commit a54dcc6

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

tests/scripts/test_plot_cog_count_barchart.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
from pathlib import Path
44

55

6-
def test_cli(cog_count_file: Path, tmp_path: Path):
7-
"""Test plot_cog_count_barchart CLI"""
6+
def test_cli_html(cog_count_file: Path, tmp_path: Path):
7+
"""Test plot_cog_count_barchart CLI (HTML format)"""
88
outfile = tmp_path / "cog_count_barchart.html"
99
cmd = f"plot_cog_count_barchart -i {cog_count_file} -o {outfile} --width 540 --height 340 --bar_width 15" # noqa: E501
1010
cmd_args = shlex.split(cmd)
1111
result = sp.run(cmd_args)
1212
assert result.returncode == 0
1313
assert outfile.exists()
14+
15+
16+
def test_cli_png(cog_count_file: Path, tmp_path: Path):
17+
"""Test plot_cog_count_barchart CLI (PNG format)"""
18+
outfile = tmp_path / "cog_count_barchart.png"
19+
cmd = f"plot_cog_count_barchart -i {cog_count_file} -o {outfile} --width 540 --height 340 --bar_width 15" # noqa: E501
20+
cmd_args = shlex.split(cmd)
21+
result = sp.run(cmd_args)
22+
assert result.returncode == 0
23+
assert outfile.exists()

tests/scripts/test_plot_cog_count_piechart.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
from pathlib import Path
44

55

6-
def test_cli(cog_count_file: Path, tmp_path: Path):
7-
"""Test plot_cog_count_piechart CLI"""
6+
def test_cli_html(cog_count_file: Path, tmp_path: Path):
7+
"""Test plot_cog_count_piechart CLI (HTML format)"""
88
outfile = tmp_path / "cog_count_barchart.html"
99
cmd = f"plot_cog_count_piechart -i {cog_count_file} -o {outfile} --width 380 --height 380 --show_letter --sort" # noqa: E501
1010
cmd_args = shlex.split(cmd)
1111
result = sp.run(cmd_args)
1212
assert result.returncode == 0
1313
assert outfile.exists()
14+
15+
16+
def test_cli_png(cog_count_file: Path, tmp_path: Path):
17+
"""Test plot_cog_count_piechart CLI (PNG format)"""
18+
outfile = tmp_path / "cog_count_barchart.png"
19+
cmd = f"plot_cog_count_piechart -i {cog_count_file} -o {outfile} --width 380 --height 380 --show_letter --sort" # noqa: E501
20+
cmd_args = shlex.split(cmd)
21+
result = sp.run(cmd_args)
22+
assert result.returncode == 0
23+
assert outfile.exists()

0 commit comments

Comments
 (0)