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>2017-02-21 06:50:51 +0100
commitee51997334672b2d4a4813c4e4ae2e4a21683fa7 (patch)
tree330a98eac59ddb791848521b457f19b702bd46c2 /test
parent525ac83bf2bb2c0a23ba78045cbfa6393a4cb2d8 (diff)
downloadobsapi-ee51997334672b2d4a4813c4e4ae2e4a21683fa7.tar.gz
obsapi-ee51997334672b2d4a4813c4e4ae2e4a21683fa7.tar.xz
obsapi-ee51997334672b2d4a4813c4e4ae2e4a21683fa7.zip
Implement locking api; refactor ObsSourceApi get/put/post calls
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