From f728ee98064776a186a154e6c931ec3c87719b98 Mon Sep 17 00:00:00 2001 From: Scott Bahling Date: Sun, 26 Jan 2020 00:53:21 +0100 Subject: Add RepoFlags class and api.get_repo_flags method --- test/test_api.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/test_api.py') diff --git a/test/test_api.py b/test/test_api.py index 1830a3d..9f57364 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -101,6 +101,21 @@ def test_get_binary_fileinfo(): bfinfo = api.get_binary_fileinfo(prj, pkg, repo, arch, binary) +def check_get_repo_flags(flag_type, prj, pkg, expected): + repo_flags = api.get_repo_flags(flag_type, prj, pkg) + assert repo_flags.flag_type == flag_type + assert len(list(repo_flags.flags)) == expected + + +def test_get_repo_build_flags(): + xml = api.get_meta(prj) + check_get_repo_flags('build', prj, None, 0) + xml = api.get_meta(prj, pkg) + meta = etree.fromstring(xml) + build = meta.find('build') + check_get_repo_flags('build', prj, pkg, len(build)) + + def test_lock_project(): api.lock(prj) xml = api.get_meta(prj) -- cgit v1.2.3