diff --git a/infrahub_sdk/ctl/repository.py b/infrahub_sdk/ctl/repository.py index 53b7f82..cafa0dd 100644 --- a/infrahub_sdk/ctl/repository.py +++ b/infrahub_sdk/ctl/repository.py @@ -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']})") @@ -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") diff --git a/tests/unit/ctl/test_repository_app.py b/tests/unit/ctl/test_repository_app.py index 741d9a3..2883117 100644 --- a/tests/unit/ctl/test_repository_app.py +++ b/tests/unit/ctl/test_repository_app.py @@ -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 @@ -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"