Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
#5 Get repository
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <uilianries@gmail.com>
  • Loading branch information
uilianries committed Jul 13, 2019
1 parent c7c59b0 commit 41131cf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bintray/bintray.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,3 +661,15 @@ def get_repositories(self, subject):
url = "{}/repos/{}".format(Bintray.BINTRAY_URL, subject)
return self._requester.get(url)

def get_repository(self, subject, repo):
""" Get general information about a repository of the specified user
Security: Authenticated user with 'read' permission for private repositories,
or repository read entitlement.
:param subject: Subject name
:param repo: Repository name
:return: Repository information
"""
url = "{}/repos/{}/{}".format(Bintray.BINTRAY_URL, subject, repo)
return self._requester.get(url)
8 changes: 8 additions & 0 deletions tests/test_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ def test_get_repositories():
bintray = Bintray()
response = bintray.get_repositories("conan")
assert {'error': False, 'statusCode': 200} in response


def test_get_repository():
bintray = Bintray()
response = bintray.get_repository("conan", "conan-center")
assert response.get("error") == False
assert response.get("statusCode") == 200
assert response.get("owner") == "conan"

0 comments on commit 41131cf

Please sign in to comment.