from obsapi.buildapi import ObsBuildApi prj = 'home:sbahling:obsapi:test' pkg = 'suse-hello-1.0' repo = 'SLE_12_SP3' arch = 'x86_64' buildapi = ObsBuildApi(apiurl='https://api.opensuse.org') def test_build_get(): xml = buildapi.get() assert '' in xml def test_build_get_prj(): xml = buildapi.get(prj) assert '' in xml def test_build_get_repo(): xml = buildapi.get(prj, repo) assert '' in xml def test_build_get_arch(): xml = buildapi.get(prj, repo, arch) assert '' in xml def test_build_get_binary_list(): xml = buildapi.get(prj, repo, arch, pkg) assert '' in xml assert '' in str(binary) def test_build_get_binary_fileinfo(): bname = 'suse-hello-1.0-1.1.src.rpm' xml = buildapi.get(prj, repo, arch, pkg, bname, view='fileinfo') assert ''.format(bname) in str(xml) def test_build_get_binary_fileinfo_ext(): bname = 'suse-hello-1.0-1.1.src.rpm' xml = buildapi.get(prj, repo, arch, pkg, bname, view='fileinfo_ext') assert ''.format(bname) in str(xml) assert '' in xml def test_build_get_buildconf(): buildconfig = buildapi.get_buildconfig(prj, repo) assert '%define _project home:sbahling:obsapi:test' in buildconfig def test_build_get_buildinfo(): xml = buildapi.get_buildinfo(prj, pkg, repo, arch) assert '' in xml def test_build_get_jobhistory_pkg(): xml = buildapi.get_jobhistory(prj, repo, arch, pkg) assert '' in xml def test_build_get_result(): xml = buildapi.get_result(prj) assert '' in xml def test_build_get_reason(): xml = buildapi.get_reason(prj, repo, arch, pkg) assert '' in xml # def test_build_get_jobstatus(): # xml = buildapi.get_jobstatus(prj, repo, arch, pkg) # assert '' in xml def test_build_get_status(): xml = buildapi.get_status(prj, repo, arch, pkg) assert '' in xml def test_build_get_repository_binary(): bname = 'suse-hello-kmp-default.rpm' binary = buildapi.get_repository(prj, repo, arch, bname) assert len(binary) == 6709