From 5b3a2b608c4c4c5d4df4b07d9322279349085dc9 Mon Sep 17 00:00:00 2001 From: Scott Bahling Date: Thu, 13 Feb 2020 15:28:00 +0100 Subject: Make sure build api arguments match order of OBS api path items. This of course breaks the API, but hopefully we stay consistent from this point forward --- obsapi/buildapi.py | 6 +++--- obsapi/core.py | 2 +- test/test_obs_build_api.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/obsapi/buildapi.py b/obsapi/buildapi.py index 19eb96e..27e9124 100644 --- a/obsapi/buildapi.py +++ b/obsapi/buildapi.py @@ -16,20 +16,20 @@ class ObsBuildApi(ObsHttpApi): def __post(self, *args, **kwargs): return super(ObsBuildApi, self).post(*args, **kwargs) - def get(self, prj='', repo='', arch='', pkg='', binaryname='', + def get(self, prj=None, repo=None, arch=None, pkg=None, binaryname=None, view=None, binary_get=False, **kwargs): if binaryname: binary_get = True return self.__get(prj, repo, arch, pkg, binaryname, view=view, binary_get=binary_get, **kwargs) - def get_builddepinfo(self, prj, pkg, repo, arch): + def get_builddepinfo(self, prj, repo, arch, pkg): return self.__get(prj, repo, arch, '_builddepinfo', package=pkg) def get_buildconfig(self, prj, repo): return self.__get(prj, repo, '_buildconfig') - def get_buildinfo(self, prj, pkg, repo, arch): + def get_buildinfo(self, prj, repo, arch, pkg): return self.__get(prj, repo, arch, pkg, '_buildinfo') def get_jobhistory(self, prj, repo, arch, pkg=None, code=None, limit=None): diff --git a/obsapi/core.py b/obsapi/core.py index 8e17de7..d0ca9e6 100644 --- a/obsapi/core.py +++ b/obsapi/core.py @@ -254,7 +254,7 @@ class ObsApi(object): return self.build.get_buildconfig(prj, repo) def get_build_info(self, prj, pkg, repo, arch): - return self.build.get_buildinfo(prj, pkg, repo, arch) + return self.build.get_buildinfo(prj, repo, arch, pkg) def get_nothing_provides(self, prj, pkg, repo, arch): tree = etree.fromstring(self.get_build_info(prj, pkg, repo, arch)) diff --git a/test/test_obs_build_api.py b/test/test_obs_build_api.py index ff271ab..573e762 100644 --- a/test/test_obs_build_api.py +++ b/test/test_obs_build_api.py @@ -103,7 +103,7 @@ def test_build_get_builddepinfo(requests_mock): uri = '{}/build/{}/{}/{}/_builddepinfo'.format(buildapi.apiurl, prj, repo, arch) text = '' requests_mock.get(uri, text=text) - xml = buildapi.get_builddepinfo(prj, pkg, repo, arch) + xml = buildapi.get_builddepinfo(prj, repo, arch, pkg) assert xml == text @@ -133,7 +133,7 @@ def test_build_get_buildinfo(requests_mock): uri = '{}/build/{}/{}/{}/{}/_buildinfo'.format(buildapi.apiurl, prj, repo, arch, pkg) text = '' requests_mock.get(uri, text=text) - xml = buildapi.get_buildinfo(prj, pkg, repo, arch) + xml = buildapi.get_buildinfo(prj, repo, arch, pkg) assert xml == text -- cgit v1.2.3