summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--obsapi/core.py5
-rw-r--r--test/test_api.py11
2 files changed, 15 insertions, 1 deletions
diff --git a/obsapi/core.py b/obsapi/core.py
index c154674..f09ce3b 100644
--- a/obsapi/core.py
+++ b/obsapi/core.py
@@ -204,7 +204,10 @@ class ObsApi(object):
def binaries_ls(self, prj, pkg, repo, arch):
binaries = []
- xml = self.build.get(prj, repo, arch, pkg)
+ if pkg is None:
+ xml = self.build.get_repository(prj, repo, arch)
+ else:
+ xml = self.build.get(prj, repo, arch, pkg)
if xml:
blist = etree.fromstring(xml)
binaries = [Binary(filename=i.get('filename'),
diff --git a/test/test_api.py b/test/test_api.py
index 2f0bf95..1830a3d 100644
--- a/test/test_api.py
+++ b/test/test_api.py
@@ -56,6 +56,17 @@ def test_binaries_ls():
assert f in items
+def test_binaries_ls_project():
+ files = ['suse-hello-debugsource.rpm',
+ 'suse-hello-kmp-default.rpm',
+ 'suse-hello-kmp-default-debuginfo.rpm',
+ ]
+ listing = api.binaries_ls(prj=prj, pkg=None, repo=repo, arch=arch)
+ items = [i.filename for i in listing]
+ for f in files:
+ assert f in items
+
+
def test_get_project_repos():
repos = api.get_project_repos(prj)
assert 'SLE_12_SP3' in repos