from obsapi.sourceapi import ObsSourceApi prj = 'Test:obsapi' pkg = 'suse-hello-1.0' repo = 'SLE_12' arch = 'x86_64' sourceapi = ObsSourceApi(apiurl='https://api.suse.com') def test_source_get_prj(): xml = sourceapi.get(prj) assert '' in xml def test_source_get_pkg(): xml = sourceapi.get(prj, pkg) assert ''.format(prj) in xml def test_source_get_meta_pkg(): xml = sourceapi.get_meta(prj, pkg) assert ''.format(pkg, prj) in xml def test_source_get_prj_attributes(): xml = sourceapi.get_attribute(prj) assert '' in xml def test_source_get_prj_attribute(): xml = sourceapi.get_attribute(prj, attribute='OBS:MaintenanceIdTemplate') assert '' in xml assert 'name="MaintenanceIdTemplate"' in xml assert 'namespace="OBS"' in xml def test_source_get_pkg_attributes(): xml = sourceapi.get_attribute(prj, pkg) assert '' in xml assert 'name="ScreenShots"' in xml assert 'namespace="OBS"' in xml def test_source_get_prj_config(): config = sourceapi.get_config(prj) assert 'Macros:' in config def test_source_get_prj_pubkey(): pubkey = sourceapi.get_pubkey(prj) assert '-BEGIN PGP PUBLIC KEY BLOCK-' in pubkey def test_source_get_history(): xml = sourceapi.get_history(prj, pkg) assert '' in xml