Skip to content

Commit

Permalink
Format/Lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
FragmentedPacket committed Jan 18, 2025
1 parent 9012b62 commit 9826af2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
12 changes: 3 additions & 9 deletions infrahub_sdk/ctl/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def get_repository_config(repo_config_file: Path) -> InfrahubRepositoryConfig:
try:
data = InfrahubRepositoryConfig(**config_file_data)
except ValidationError as exc:
console.print(
f"[red]Repository config file not valid, found {len(exc.errors())} error(s)"
)
console.print(f"[red]Repository config file not valid, found {len(exc.errors())} error(s)")
for error in exc.errors():
loc_str = [str(item) for item in error["loc"]]
console.print(f" {'/'.join(loc_str)} | {error['msg']} ({error['type']})")
Expand Down Expand Up @@ -104,13 +102,9 @@ async def add(
input_data["data"]["credential"] = {"id": credential.id}

query = Mutation(
mutation="CoreReadOnlyRepositoryCreate"
if read_only
else "CoreRepositoryCreate",
mutation="CoreReadOnlyRepositoryCreate" if read_only else "CoreRepositoryCreate",
input_data=input_data,
query={"ok": None},
)

await client.execute_graphql(
query=query.render(), branch_name=branch, tracker="mutation-repository-create"
)
await client.execute_graphql(query=query.render(), branch_name=branch, tracker="mutation-repository-create")
8 changes: 2 additions & 6 deletions tests/unit/ctl/test_repository_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

runner = CliRunner()

requires_python_310 = pytest.mark.skipif(
sys.version_info < (3, 10), reason="Requires Python 3.10 or higher"
)
requires_python_310 = pytest.mark.skipif(sys.version_info < (3, 10), reason="Requires Python 3.10 or higher")


@pytest.fixture
Expand Down Expand Up @@ -262,9 +260,7 @@ def test_repo_readonly_true(self, mock_init_client, mock_client) -> None:
)

@requires_python_310
def test_repo_description_commit_branch(
self, mock_init_client, mock_client
) -> None:
def test_repo_description_commit_branch(self, mock_init_client, mock_client) -> None:
"""Case allow no username to be passed in and set it as None rather than blank string that fails."""
mock_cred = mock.AsyncMock()
mock_cred.id = "1234"
Expand Down

0 comments on commit 9826af2

Please sign in to comment.