def review_snap(*, snap_file: str) -> None: # Review the snap. if review_tools.is_available(): echo.info( "Running the review tools before pushing this snap to the Snap " "Store." ) # TODO just raise when we can override. try: review_tools.run(snap_filename=snap_file) except review_tools.errors.ReviewError as review_error: echo.warning(review_error.get_brief()) echo.warning(review_error.get_resolution()) # This can get too colorful if we don't just print it. click.echo(review_error.get_details()) elif sys.platform == "linux": echo.warning( "Install the review-tools from the Snap Store for enhanced checks " "before uploading this snap." )
def test_review_good(self): review_tools.run(snap_filename="fake.snap") self.assert_fake_check_output_called()