Fixed a bug in gitea.Gitea.get_accessible_repositories()

The method now uses `self` instead of `self.gitea` to access the connection.
pull/5/head
Holger Frey 2021-05-06 15:04:20 +02:00
rodzic f9a2ae6f97
commit d0fe221e54
2 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -801,8 +801,8 @@ class Gitea:
def get_accessible_repositories(self) -> List[GiteaApiObject]:
""" Get all Repositories accessible by the logged in User."""
results = self.gitea.requests_get("/user/repos")
return [Repository.parse_response(self.gitea, result) for result in results]
results = self.requests_get("/user/repos")
return [Repository.parse_response(self, result) for result in results]
def get_users_following(self, username):
path = "/users/" + username + "/following"

Wyświetl plik

@ -7,7 +7,7 @@ from gitea import NotFoundException, AlreadyExistsException
# put a ".token" file into your directory containg only the token for gitea
@pytest.fixture
def instance(scope="module"):
try:
try:
g = Gitea("http://localhost:3000", open(".token", "r").read().strip())
print("Gitea Version: " + g.get_version())
print("API-Token belongs to user: " + g.get_user().username)
@ -200,3 +200,8 @@ def test_delete_user(instance):
user.delete()
with pytest.raises(NotFoundException) as e:
User.request(instance, test_user)
def test_get_accessible_repositories(instance):
repos = instance.get_accessible_repositories()
assert repos == []