From a18f3cfa17584b4c9f69b6fb73695ba0230315da Mon Sep 17 00:00:00 2001 From: "jesus m. rodriguez" Date: Tue, 14 Jul 2009 13:44:21 -0400 Subject: added test list methods to determine best course of action for JSONifying lists --- proxy/code/scripts/test-userapi.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'proxy/code/scripts/test-userapi.py') diff --git a/proxy/code/scripts/test-userapi.py b/proxy/code/scripts/test-userapi.py index 32714e9..6fba16e 100755 --- a/proxy/code/scripts/test-userapi.py +++ b/proxy/code/scripts/test-userapi.py @@ -13,11 +13,31 @@ headers = {"Content-type":"application/json", conn = httplib.HTTPConnection("localhost", 8080) conn.request("POST", '/candlepin/user', params, headers) response = conn.getresponse() -print response.status, response.reason +print("Status: %d Response: %s" % (response.status, response.reason)) rsp = response.read() conn.close() -print rsp +print("create: %s" % rsp) response = urllib.urlopen('http://localhost:8080/candlepin/user/candlepin') rsp = response.read() -print(rsp) +print("get: %s" % rsp) + +response = urllib.urlopen('http://localhost:8080/candlepin/user/list') +rsp = response.read() +print("list: %s" % rsp) + +response = urllib.urlopen('http://localhost:8080/candlepin/user/listusers') +rsp = response.read() +print("listusers: %s" % rsp) + +response = urllib.urlopen('http://localhost:8080/candlepin/user/uselist') +rsp = response.read() +print("uselist: %s" % rsp) + +response = urllib.urlopen('http://localhost:8080/candlepin/user/listobjects') +rsp = response.read() +print("listobjects: %s" % rsp) + +response = urllib.urlopen('http://localhost:8080/candlepin/user/listbasemodel') +rsp = response.read() +print("listbasemodel: %s" % rsp) -- cgit