diff options
| author | Scott Bahling <sbahling@suse.com> | 2020-01-25 22:01:49 +0100 |
|---|---|---|
| committer | Scott Bahling <sbahling@suse.com> | 2020-01-25 22:10:04 +0100 |
| commit | 47b21a0ed5eee2fd6180715c981ec06d4203a522 (patch) | |
| tree | 2de834acad8e5ea96163aa38385c539067bca304 /test | |
| parent | fe0af7003bbb783814c50f317d35aadc45c82fc6 (diff) | |
| download | obsapi-47b21a0ed5eee2fd6180715c981ec06d4203a522.tar.gz obsapi-47b21a0ed5eee2fd6180715c981ec06d4203a522.tar.xz obsapi-47b21a0ed5eee2fd6180715c981ec06d4203a522.zip | |
Fix get_repository call for retrieving binary objects
Enhance test case
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_obs_build_api.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test/test_obs_build_api.py b/test/test_obs_build_api.py index 95b8fa3..39b6868 100644 --- a/test/test_obs_build_api.py +++ b/test/test_obs_build_api.py @@ -1,4 +1,5 @@ from obsapi.buildapi import ObsBuildApi +from lxml import etree prj = 'home:sbahling:obsapi:test' pkg = 'suse-hello-1.0' @@ -115,10 +116,17 @@ def test_build_get_log(): def test_build_get_repository(): xml = buildapi.get_repository(prj, repo, arch) - assert '<binarylist>' in xml + assert '<binarylist' 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 + xml = buildapi.get_repository(prj, repo, arch) + root = etree.fromstring(xml) + entries = root.findall('binary') + assert entries is not None + for entry in entries: + bname = entry.get('filename') + size = entry.get('size') + binary = buildapi.get_repository(prj, repo, arch, bname) + assert binary is not None + assert len(binary) == int(size) |
