summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorScott Bahling <sbahling@suse.de>2016-09-14 12:11:47 +0200
committerScott Bahling <sbahling@suse.de>2016-09-14 12:11:47 +0200
commit2f71f136702ba9fdf740ce9f2598cd804370516b (patch)
tree62718a8ee094e052229f93dac3bb32e7e9078d2b /test
parent525ac83bf2bb2c0a23ba78045cbfa6393a4cb2d8 (diff)
downloadobsapi-0.0.6.tar.gz
obsapi-0.0.6.tar.xz
obsapi-0.0.6.zip
Implement locking api; refactor ObsSourceApi get/put/post callsobsapi-0.0.6
Diffstat (limited to 'test')
-rw-r--r--test/test_api.py24
1 files changed, 24 insertions, 0 deletions
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