From 678bcb6c065a6ecac89f429309d46b0888299189 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Fri, 20 Nov 2009 12:54:07 -0500 Subject: call owner/$uuid (aka, OwnerResource.get()) --- proxy/code/scripts/test-ownerapi.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'proxy/code/scripts/test-ownerapi.py') 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) -- cgit