summaryrefslogtreecommitdiffstats
path: root/proxy/code/scripts/test-ownerapi.py
diff options
context:
space:
mode:
Diffstat (limited to 'proxy/code/scripts/test-ownerapi.py')
-rwxr-xr-xproxy/code/scripts/test-ownerapi.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/proxy/code/scripts/test-ownerapi.py b/proxy/code/scripts/test-ownerapi.py
index 6b4f501..83ccbbc 100755
--- a/proxy/code/scripts/test-ownerapi.py
+++ b/proxy/code/scripts/test-ownerapi.py
@@ -3,8 +3,21 @@
import httplib, urllib
import sys
import simplejson
+import pprint
+
+# test OwnerResourse.list
response = urllib.urlopen('http://localhost:8080/candlepin/owner')
rsp = response.read()
print("get: %s" % rsp)
+result = simplejson.loads(rsp)
+pprint.pprint(result)
+
+
+# test OwnerResourse.get
+for owner in result['owner']:
+ response = urllib.urlopen('http://localhost:8080/candlepin/owner/%s' % owner['uuid'])
+ rsp = response.read()
+ result = simplejson.loads(rsp)
+ pprint.pprint(result)