Merge pull request #5 from holgi/master

Fixed to small bugs
pull/7/head
Langenfeld 2021-05-06 16:13:07 +02:00 zatwierdzone przez GitHub
commit 3816745354
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 13 dodań i 5 usunięć

3
.gitignore vendored
Wyświetl plik

@ -1,3 +1,6 @@
*.pyc *.pyc
.*.sw* .*.sw*
*.token *.token
# local virtual environment
.venv

Wyświetl plik

@ -464,8 +464,8 @@ class Issue(GiteaApiObject):
GET_COMMENTS = """/repos/%s/%s/issues/comments""" GET_COMMENTS = """/repos/%s/%s/issues/comments"""
CREATE_ISSUE = """/repos/{owner}/{repo}/issues""" CREATE_ISSUE = """/repos/{owner}/{repo}/issues"""
OPENED = "closed" OPENED = "open"
CLOSED = "open" CLOSED = "closed"
def __init__(self, gitea, id: int): def __init__(self, gitea, id: int):
super(Issue, self).__init__(gitea, id=id) super(Issue, self).__init__(gitea, id=id)
@ -801,8 +801,8 @@ class Gitea:
def get_accessible_repositories(self) -> List[GiteaApiObject]: def get_accessible_repositories(self) -> List[GiteaApiObject]:
""" Get all Repositories accessible by the logged in User.""" """ Get all Repositories accessible by the logged in User."""
results = self.gitea.requests_get("/user/repos") results = self.requests_get("/user/repos")
return [Repository.parse_response(self.gitea, result) for result in results] return [Repository.parse_response(self, result) for result in results]
def get_users_following(self, username): def get_users_following(self, username):
path = "/users/" + username + "/following" path = "/users/" + username + "/following"

Wyświetl plik

@ -200,3 +200,8 @@ def test_delete_user(instance):
user.delete() user.delete()
with pytest.raises(NotFoundException) as e: with pytest.raises(NotFoundException) as e:
User.request(instance, test_user) User.request(instance, test_user)
def test_get_accessible_repositories(instance):
repos = instance.get_accessible_repositories()
assert repos == []