summaryrefslogtreecommitdiffstats
path: root/proxy/code/scripts/test-ownerapi.py
blob: 83ccbbcd26a5aed97a63e353f5166c95e7f75d6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python

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)