diff options
| author | Scott Bahling <sbahling@suse.de> | 2016-09-14 12:11:47 +0200 |
|---|---|---|
| committer | Scott Bahling <sbahling@suse.de> | 2016-09-14 12:11:47 +0200 |
| commit | 2f71f136702ba9fdf740ce9f2598cd804370516b (patch) | |
| tree | 62718a8ee094e052229f93dac3bb32e7e9078d2b /test/test_api.py | |
| parent | 525ac83bf2bb2c0a23ba78045cbfa6393a4cb2d8 (diff) | |
| download | obsapi-2f71f136702ba9fdf740ce9f2598cd804370516b.tar.gz obsapi-2f71f136702ba9fdf740ce9f2598cd804370516b.tar.xz obsapi-2f71f136702ba9fdf740ce9f2598cd804370516b.zip | |
Implement locking api; refactor ObsSourceApi get/put/post callsobsapi-0.0.6
Diffstat (limited to 'test/test_api.py')
| -rw-r--r-- | test/test_api.py | 24 |
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 |
