Skip to content

Commit

Permalink
Merge pull request #219 from avi-biton/remove_path
Browse files Browse the repository at this point in the history
chore(RHTAPWATCH-1285): remove the input of status-path
  • Loading branch information
avi-biton authored Sep 10, 2024
2 parents c5bb0bb + 580edc6 commit 4d86867
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
19 changes: 6 additions & 13 deletions tests/test_rpm_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,6 @@ def _mock_generate_output(with_failures: bool = False) -> MagicMock:

return _mock_generate_output

@pytest.fixture()
def status_path(self, tmp_path: Path) -> Path:
"""Status temp file"""
return tmp_path / "status"

@pytest.mark.parametrize(
("fail_unsigned", "has_errors"),
[
Expand All @@ -383,9 +378,10 @@ def test_main( # pylint: disable=too-many-arguments
mock_image_processor: MagicMock,
fail_unsigned: bool,
has_errors: bool,
status_path: Path,
tmp_path: Path,
) -> None:
"""Test call to rpm_verifier.py main function"""
status_path = tmp_path / "status"
generate_output_mock = create_generate_output_mock(with_failures=has_errors)
rpm_verifier.main( # pylint: disable=no-value-for-parameter
args=[
Expand All @@ -394,9 +390,7 @@ def test_main( # pylint: disable=too-many-arguments
"--fail-unsigned",
fail_unsigned,
"--workdir",
"some/path",
"--status-path",
str(status_path),
tmp_path,
],
obj={},
standalone_mode=False,
Expand All @@ -415,11 +409,12 @@ def test_main_fail_on_unsigned_rpm_or_errors(
self,
create_generate_output_mock: MagicMock,
mock_image_processor: MagicMock, # pylint: disable=unused-argument
status_path: Path,
tmp_path: Path,
) -> None:
"""Test call to rpm_verifier.py main function fails
when whe 'fail-unsigned' flag is used and there are unsigned RPMs
"""
status_path = tmp_path / "status"
fail_unsigned: bool = True
generate_output_mock = create_generate_output_mock(with_failures=True)
with pytest.raises(SystemExit) as err:
Expand All @@ -430,9 +425,7 @@ def test_main_fail_on_unsigned_rpm_or_errors(
"--fail-unsigned",
fail_unsigned,
"--workdir",
"some/path",
"--status-path",
str(status_path),
tmp_path,
],
obj={},
standalone_mode=False,
Expand Down
9 changes: 1 addition & 8 deletions verify_rpms/rpm_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,13 @@ def __call__(self, img: str) -> ProcessedImage:
type=click.Path(path_type=Path),
required=True,
)
@click.option(
"--status-path",
help="Path in which the status will be written to",
type=click.Path(path_type=Path),
required=True,
)
def main(
img_input: str,
fail_unsigned: bool,
workdir: Path,
status_path: Path,
) -> None:
"""Verify RPMs are signed"""

status_path: Path = workdir / "status"
processor = ImageProcessor(workdir=workdir)
processed_image = processor(img=img_input)

Expand Down

0 comments on commit 4d86867

Please sign in to comment.