summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/obsapi_test_prj_meta.xml9
-rw-r--r--test/test_obs_source_api.py11
2 files changed, 20 insertions, 0 deletions
diff --git a/test/obsapi_test_prj_meta.xml b/test/obsapi_test_prj_meta.xml
new file mode 100644
index 0000000..b0fc4aa
--- /dev/null
+++ b/test/obsapi_test_prj_meta.xml
@@ -0,0 +1,9 @@
+<project name="__PRJ__">
+ <title>Test project for obsapi unit tests</title>
+ <description/>
+ <person userid="sbahling" role="maintainer"/>
+ <repository name="SLE_12_SP3">
+ <path project="SUSE:SLE-12-SP3:GA" repository="standard"/>
+ <arch>x86_64</arch>
+ </repository>
+</project>
diff --git a/test/test_obs_source_api.py b/test/test_obs_source_api.py
index a170713..c8b7ec6 100644
--- a/test/test_obs_source_api.py
+++ b/test/test_obs_source_api.py
@@ -1,4 +1,5 @@
from obsapi.sourceapi import ObsSourceApi
+import os
prj = 'home:sbahling:obsapi:test'
@@ -8,6 +9,16 @@ arch = 'x86_64'
sourceapi = ObsSourceApi(apiurl='https://api.opensuse.org')
+modpath = os.path.dirname(os.path.realpath(__file__))
+
+
+def test_source_put_meta():
+ prj = 'home:sbahling:obsapi:t1'
+ with open(os.path.join(modpath, 'obsapi_test_prj_meta.xml')) as f:
+ xml = f.read().replace('__PRJ__', prj)
+ response = sourceapi.put_meta(prj, xml)
+ assert '<status code="ok">' in response.content
+
def test_source_get_prj():
xml = sourceapi.get(prj)