Ruff after aider
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 24s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 23s

This commit is contained in:
Jon Michael Aanes 2025-04-15 23:39:40 +02:00
parent a8a8fbfbbd
commit 2a365a9a59
2 changed files with 12 additions and 7 deletions

View File

@ -169,7 +169,9 @@ class GiteaClient:
response.raise_for_status() response.raise_for_status()
return response.json() return response.json()
def get_pull_request_comments(self, owner: str, repo: str, pull_number: int) -> list[dict]: def get_pull_request_comments(
self, owner: str, repo: str, pull_number: int,
) -> list[dict]:
"""Get comments for a specific pull request. """Get comments for a specific pull request.
Args: Args:

View File

@ -1,5 +1,4 @@
import pytest from unittest.mock import MagicMock, patch
from unittest.mock import patch, MagicMock
from aider_gitea.gitea_client import GiteaClient from aider_gitea.gitea_client import GiteaClient
@ -34,11 +33,13 @@ class TestGiteaClientPRComments:
mock_get.return_value = mock_response mock_get.return_value = mock_response
# Call the method # Call the method
comments = self.client.get_pull_request_comments(self.owner, self.repo, self.pull_number) comments = self.client.get_pull_request_comments(
self.owner, self.repo, self.pull_number,
)
# Verify the request was made correctly # Verify the request was made correctly
mock_get.assert_called_once_with( mock_get.assert_called_once_with(
f'{self.client.gitea_url}/repos/{self.owner}/{self.repo}/pulls/{self.pull_number}/comments' f'{self.client.gitea_url}/repos/{self.owner}/{self.repo}/pulls/{self.pull_number}/comments',
) )
# Verify the response was processed correctly # Verify the response was processed correctly
@ -57,11 +58,13 @@ class TestGiteaClientPRComments:
mock_get.return_value = mock_response mock_get.return_value = mock_response
# Call the method # Call the method
comments = self.client.get_pull_request_comments(self.owner, self.repo, self.pull_number) comments = self.client.get_pull_request_comments(
self.owner, self.repo, self.pull_number,
)
# Verify the request was made correctly # Verify the request was made correctly
mock_get.assert_called_once_with( mock_get.assert_called_once_with(
f'{self.client.gitea_url}/repos/{self.owner}/{self.repo}/pulls/{self.pull_number}/comments' f'{self.client.gitea_url}/repos/{self.owner}/{self.repo}/pulls/{self.pull_number}/comments',
) )
# Verify the response was processed correctly # Verify the response was processed correctly