Skip to content

Commit db68d0e

Browse files
committed
fix: unstyle CLI help output for clearer command visibility
1 parent f18c84c commit db68d0e

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

tests/test_cli.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from pathlib import Path
1414

1515
import pytest
16+
from click import unstyle
1617
from typer.testing import CliRunner
1718

1819
from mitreattack.attackToExcel import attackToExcel
@@ -387,22 +388,25 @@ def test_attack_to_excel_cli_rejects_root_legacy_domain(attack_to_excel_runner:
387388
def test_attack_to_excel_cli_help_lists_subcommands(attack_to_excel_runner: CliRunner):
388389
"""attack-to-excel help should expose the from-stix and from-release subcommands."""
389390
result = attack_to_excel_runner.invoke(attackToExcel.app, ["--help"])
391+
root_help = unstyle(result.output)
390392

391393
assert result.exit_code == 0
392-
assert "from-stix" in result.output
393-
assert "from-release" in result.output
394+
assert "from-stix" in root_help
395+
assert "from-release" in root_help
394396

395397
from_stix_help = attack_to_excel_runner.invoke(attackToExcel.app, ["from-stix", "--help"])
398+
from_stix_output = unstyle(from_stix_help.output)
396399
assert from_stix_help.exit_code == 0
397-
assert "--domain" in from_stix_help.output
398-
assert "--remote" in from_stix_help.output
399-
assert "--stix-file" in from_stix_help.output
400+
assert "--domain" in from_stix_output
401+
assert "--remote" in from_stix_output
402+
assert "--stix-file" in from_stix_output
400403

401404
from_release_help = attack_to_excel_runner.invoke(attackToExcel.app, ["from-release", "--help"])
405+
from_release_output = unstyle(from_release_help.output)
402406
assert from_release_help.exit_code == 0
403-
assert "--domains" in from_release_help.output
404-
assert "--stix-version" in from_release_help.output
405-
assert "--stix-base-dir" in from_release_help.output
407+
assert "--domains" in from_release_output
408+
assert "--stix-version" in from_release_output
409+
assert "--stix-base-dir" in from_release_output
406410

407411

408412
def test_attack_to_excel_cli_no_args_shows_help(attack_to_excel_runner: CliRunner):

0 commit comments

Comments
 (0)