diff options
| -rw-r--r-- | test/test_api.py | 30 | ||||
| -rw-r--r-- | test/test_obs_build_api.py | 16 | ||||
| -rw-r--r-- | test/test_obs_source_api.py | 12 |
3 files changed, 29 insertions, 29 deletions
diff --git a/test/test_api.py b/test/test_api.py index e32c66e..61ddae0 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -1,11 +1,11 @@ from obsapi import ObsApi from lxml import etree -api = ObsApi(apiurl='https://api.suse.com') +api = ObsApi(apiurl='https://api.opensuse.org') -prj = 'Test:obsapi' +prj = 'home:sbahling:obsapi:test' pkg = 'suse-hello-1.0' -repo = 'SLE_12' +repo = 'SLE_12_SP3' arch = 'x86_64' @@ -33,8 +33,8 @@ def test_ls_pkg(): def test_ls_binaries(): - files = ['_statistics', 'rpmlint.log', 'suse-hello-1.0-2.1.src.rpm', - 'suse-hello-kmp-default-1.0_k3.12.28_4-2.1.x86_64.rpm', + files = ['_statistics', 'rpmlint.log', 'suse-hello-1.0-1.1.src.rpm', + 'suse-hello-kmp-default-1.0_k4.4.73_5-1.1.x86_64.rpm', ] listing = api.ls(prj=prj, pkg=pkg, repo=repo, arch=arch) items = [i.filename for i in listing] @@ -43,8 +43,8 @@ def test_ls_binaries(): def test_binaries_ls(): - files = ['_statistics', 'rpmlint.log', 'suse-hello-1.0-2.1.src.rpm', - 'suse-hello-kmp-default-1.0_k3.12.28_4-2.1.x86_64.rpm', + files = ['_statistics', 'rpmlint.log', 'suse-hello-1.0-1.1.src.rpm', + 'suse-hello-kmp-default-1.0_k4.4.73_5-1.1.x86_64.rpm', ] listing = api.binaries_ls(prj=prj, pkg=pkg, repo=repo, arch=arch) items = [i.filename for i in listing] @@ -54,7 +54,7 @@ def test_binaries_ls(): def test_get_project_repos(): repos = api.get_project_repos(prj) - assert 'SLE_12' in repos + assert 'SLE_12_SP3' in repos def test_get_vendor(): @@ -64,21 +64,21 @@ def test_get_vendor(): def test_source_info(): sinfo = api.get_source_info(prj, pkg) assert sinfo.package == 'suse-hello-1.0' - assert sinfo.rev == '2' - assert sinfo.vrev == '2' + assert sinfo.rev == '1' + assert sinfo.vrev == '1' assert sinfo.srcmd5 == '7054c47fb2ebde13fc62ee64d0a3b1bc' assert sinfo.verifymd5 == '7054c47fb2ebde13fc62ee64d0a3b1bc' def test_get_binary_fileinfo(): - binary = 'suse-hello-kmp-default-1.0_k3.12.28_4-2.1.x86_64.rpm' + binary = 'suse-hello-kmp-default-1.0_k4.4.73_5-1.1.x86_64.rpm' bfinfo = api.get_binary_fileinfo(prj, pkg, repo, arch, binary) assert bfinfo.filename == binary - assert bfinfo.size == '25869' - assert bfinfo.mtime == '1429457162' + assert bfinfo.size == '6709' + assert bfinfo.mtime == '1507137122' assert bfinfo.arch == 'x86_64' - assert bfinfo.version == '1.0_k3.12.28_4' - assert bfinfo.release == '2.1' + assert bfinfo.version == '1.0_k4.4.73_5' + assert bfinfo.release == '1.1' assert bfinfo.summary == 'Sample Kernel Module Package' assert bfinfo.description == 'This package contains the hello.ko module.' assert bfinfo.source == 'suse-hello' diff --git a/test/test_obs_build_api.py b/test/test_obs_build_api.py index 08515ec..93d7577 100644 --- a/test/test_obs_build_api.py +++ b/test/test_obs_build_api.py @@ -1,11 +1,11 @@ from obsapi.buildapi import ObsBuildApi -prj = 'Test:obsapi' +prj = 'home:sbahling:obsapi:test' pkg = 'suse-hello-1.0' -repo = 'SLE_12' +repo = 'SLE_12_SP3' arch = 'x86_64' -buildapi = ObsBuildApi(apiurl='https://api.suse.com') +buildapi = ObsBuildApi(apiurl='https://api.opensuse.org') def test_build_get(): @@ -31,7 +31,7 @@ def test_build_get_arch(): def test_build_get_binary_list(): xml = buildapi.get(prj, repo, arch, pkg) assert '<binarylist>' in xml - assert '<binary filename="suse-hello-1.0-2.1.src.rpm"' in xml + assert '<binary filename="suse-hello-1.0-1.1.src.rpm"' in xml def test_build_get_binary(): @@ -41,13 +41,13 @@ def test_build_get_binary(): def test_build_get_binary_fileinfo(): - bname = 'suse-hello-1.0-2.1.src.rpm' + bname = 'suse-hello-1.0-1.1.src.rpm' xml = buildapi.get(prj, repo, arch, pkg, bname, view='fileinfo') assert '<fileinfo filename="{}">'.format(bname) in xml def test_build_get_binary_fileinfo_ext(): - bname = 'suse-hello-1.0-2.1.src.rpm' + bname = 'suse-hello-1.0-1.1.src.rpm' xml = buildapi.get(prj, repo, arch, pkg, bname, view='fileinfo_ext') assert '<fileinfo filename="{}">'.format(bname) in xml assert '<requires_ext' in xml @@ -60,7 +60,7 @@ def test_build_get_builddepinfo(): def test_build_get_buildconf(): buildconfig = buildapi.get_buildconfig(prj, repo) - assert '%define _project Test:obsapi' in buildconfig + assert '%define _project home:sbahling:obsapi:test' in buildconfig def test_build_get_buildinfo(): @@ -121,4 +121,4 @@ def test_build_get_repository(): def test_build_get_repository_binary(): bname = 'suse-hello-kmp-default.rpm' binary = buildapi.get_repository(prj, repo, arch, bname) - assert len(binary) == 25869 + assert len(binary) == 6709 diff --git a/test/test_obs_source_api.py b/test/test_obs_source_api.py index 205e344..a170713 100644 --- a/test/test_obs_source_api.py +++ b/test/test_obs_source_api.py @@ -1,12 +1,12 @@ from obsapi.sourceapi import ObsSourceApi -prj = 'Test:obsapi' +prj = 'home:sbahling:obsapi:test' pkg = 'suse-hello-1.0' -repo = 'SLE_12' +repo = 'SLE_12_SP3' arch = 'x86_64' -sourceapi = ObsSourceApi(apiurl='https://api.suse.com') +sourceapi = ObsSourceApi(apiurl='https://api.opensuse.org') def test_source_get_prj(): @@ -40,16 +40,16 @@ def test_source_get_prj_attributes(): def test_source_get_prj_attribute(): - xml = sourceapi.get_attribute(prj, attribute='OBS:MaintenanceIdTemplate') + xml = sourceapi.get_attribute(prj, attribute='OBS:Screenshots') assert '<attributes>' in xml - assert 'name="MaintenanceIdTemplate"' in xml + assert 'name="Screenshots"' in xml assert 'namespace="OBS"' in xml def test_source_get_pkg_attributes(): xml = sourceapi.get_attribute(prj, pkg) assert '<attributes>' in xml - assert 'name="ScreenShots"' in xml + assert 'name="Screenshots"' in xml assert 'namespace="OBS"' in xml |
