Skip to content

Commit

Permalink
PSCE-251: refactor(cli): removes reusable CLI code to cli_base to ena…
Browse files Browse the repository at this point in the history
…ble multip… (RedHatProductSecurity#54)

* refactor(cli): removes reusable CLI code to cli_base to enable multiple entrypoints

Signed-off-by: Jennifer Power <[email protected]>

* chore: adds comment fixes in cli_base

Signed-off-by: Jennifer Power <[email protected]>

---------

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Oct 9, 2023
1 parent b466e9f commit 533ce28
Show file tree
Hide file tree
Showing 6 changed files with 319 additions and 247 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# trestle-bot

trestle-bot assists users in leveraging [Compliance-Trestle](https://github.com/IBM/compliance-trestle) in automated workflows or [OSCAL](https://github.com/usnistgov/OSCAL) formatted compliance content management.
trestle-bot assists users in leveraging [Compliance-Trestle](https://github.com/IBM/compliance-trestle) in automated workflows for [OSCAL](https://github.com/usnistgov/OSCAL) formatted compliance content management.

> WARNING: This project is currently under initial development. APIs may be changed incompatibly from one commit to another.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ readme = 'README.md'
repository = 'https://github.com/RedHatProductSecurity/trestle-bot'

[tool.poetry.scripts]
trestle-bot = "trestlebot.cli:run"
trestle-bot = "trestlebot.cli:main"

[tool.poetry.dependencies]
python = '^3.8.1'
Expand Down
4 changes: 2 additions & 2 deletions tests/trestlebot/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import pytest

from trestlebot.cli import run as cli_main
from trestlebot.cli import main as cli_main


@pytest.fixture
Expand Down Expand Up @@ -114,7 +114,7 @@ def test_with_target_branch(

# Patch is_github_actions since these tests will be running in
# GitHub Actions
with patch("trestlebot.cli.is_github_actions") as mock_check:
with patch("trestlebot.cli_base.is_github_actions") as mock_check:
mock_check.return_value = False

with pytest.raises(SystemExit):
Expand Down
2 changes: 1 addition & 1 deletion trestlebot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def init() -> None:
"""Initialize trestlebot"""
if __name__ == "__main__":
trestlebot.cli.run()
trestlebot.cli.main()


init()
Loading

0 comments on commit 533ce28

Please sign in to comment.