Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and F-X64 committed Oct 25, 2022
1 parent fe65058 commit f3c32a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/rhelocator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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))

Expand Down
3 changes: 2 additions & 1 deletion src/rhelocator/update_images/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f3c32a6

Please sign in to comment.