From 2f71f136702ba9fdf740ce9f2598cd804370516b Mon Sep 17 00:00:00 2001 From: Scott Bahling Date: Wed, 14 Sep 2016 12:11:47 +0200 Subject: Implement locking api; refactor ObsSourceApi get/put/post calls --- test/test_api.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/test_api.py') diff --git a/test/test_api.py b/test/test_api.py index 054a7df..e32c66e 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -84,3 +84,27 @@ def test_get_binary_fileinfo(): assert bfinfo.source == 'suse-hello' binary = '_statistics' bfinfo = api.get_binary_fileinfo(prj, pkg, repo, arch, binary) + + +def test_lock_project(): + api.lock(prj) + xml = api.get_meta(prj) + print(xml) + meta = etree.fromstring(xml) + lock = meta.find('lock') + assert lock is not None + assert lock.find('enable') is not None + + +def test_unlock_project(): + api.unlock(prj) + meta = etree.fromstring(api.get_meta(prj)) + lock = meta.find('lock') + assert lock is None + + +def test_project_locked(): + api.lock(prj) + assert api.locked(prj) is True + api.unlock(prj) + assert api.locked(prj) is False -- cgit v1.2.3