From f3c32a6618af87b456261ac2e0304b7d9c92ffd9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 05:31:54 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/rhelocator/cli.py | 6 +++--- src/rhelocator/update_images/azure.py | 3 ++- tests/test_cli.py | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/rhelocator/cli.py b/src/rhelocator/cli.py index 59979f01..df11b3d4 100644 --- a/src/rhelocator/cli.py +++ b/src/rhelocator/cli.py @@ -20,7 +20,7 @@ def cli() -> None: @click.command() @click.option("--region", help="AWS region to query (optional)", type=str) def aws_hourly_images(region: str) -> None: - """Dump AWS hourly images from a region in JSON format""" + """Dump AWS hourly images from a region in JSON format.""" # Verify that the user provided a region. if not region: raise click.UsageError( @@ -47,14 +47,14 @@ def aws_regions() -> None: @click.command() def gcp_images() -> None: - """Dump GCP images for all regions in JSON format""" + """Dump GCP images for all regions in JSON format.""" images = gcp.get_images() click.echo(json.dumps(images, indent=2)) @click.command() def azure_images() -> None: - """Dump Azure images from a region in JSON format""" + """Dump Azure images from a region in JSON format.""" images = azure.get_images() click.echo(json.dumps(images, indent=2)) diff --git a/src/rhelocator/update_images/azure.py b/src/rhelocator/update_images/azure.py index 39edec41..56e2dd0f 100644 --- a/src/rhelocator/update_images/azure.py +++ b/src/rhelocator/update_images/azure.py @@ -7,7 +7,8 @@ def get_access_token() -> str: - """Authenticate with Azure and return the access token to use with API requests. + """Authenticate with Azure and return the access token to use with API + requests. Returns: Access token as a string. diff --git a/tests/test_cli.py b/tests/test_cli.py index 4920feb8..e72c8bbf 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -17,7 +17,8 @@ def runner(): @pytest.mark.e2e def test_aws_hourly_images_live_opt_in_region(runner): - """Run a live test against the AWS API to get hourly images for opt-in regions. + """Run a live test against the AWS API to get hourly images for opt-in + regions. Further reading: https://github.com/redhatcloudx/rhelocator/issues/43 """ @@ -59,7 +60,8 @@ def test_aws_hourly_images_missing_region(runner): def test_aws_hourly_images_invalid_region(mock_aws_regions, runner): - """Simulate a failure to provide a valid region for the hourly images command.""" + """Simulate a failure to provide a valid region for the hourly images + command.""" result = runner.invoke(cli.aws_hourly_images, ["--region=antarctica-west-99"]) assert "antarctica-west-99 is not valid" in result.output