diff options
author | jesus m. rodriguez <jesusr@redhat.com> | 2009-07-30 09:18:29 -0400 |
---|---|---|
committer | jesus m. rodriguez <jesusr@redhat.com> | 2009-07-30 09:18:29 -0400 |
commit | c48be8d27883cb7ca0527b4d3b8003bdc2f6fe28 (patch) | |
tree | 3c66ac65e31aad81e05535e2fe1f42cf4cfb1861 /proxy/code/scripts/test-userapi.py | |
parent | e53b58df385618405f055a11cc5019253a587490 (diff) | |
download | candlepin-c48be8d27883cb7ca0527b4d3b8003bdc2f6fe28.tar.gz candlepin-c48be8d27883cb7ca0527b4d3b8003bdc2f6fe28.tar.xz candlepin-c48be8d27883cb7ca0527b4d3b8003bdc2f6fe28.zip |
add src jars for easier debugging.
Diffstat (limited to 'proxy/code/scripts/test-userapi.py')
-rwxr-xr-x | proxy/code/scripts/test-userapi.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/proxy/code/scripts/test-userapi.py b/proxy/code/scripts/test-userapi.py index 6fba16e..45cc004 100755 --- a/proxy/code/scripts/test-userapi.py +++ b/proxy/code/scripts/test-userapi.py @@ -17,7 +17,7 @@ print("Status: %d Response: %s" % (response.status, response.reason)) rsp = response.read() conn.close() print("create: %s" % rsp) - +""" response = urllib.urlopen('http://localhost:8080/candlepin/user/candlepin') rsp = response.read() print("get: %s" % rsp) @@ -41,3 +41,20 @@ print("listobjects: %s" % rsp) response = urllib.urlopen('http://localhost:8080/candlepin/user/listbasemodel') rsp = response.read() print("listbasemodel: %s" % rsp) + +print("TESTING json get") +response = urllib.urlopen("http://localhost:8080/candlepin/user/testobject") +rsp = response.read() +print("testjsonobject get: %s" % rsp) +""" + +print("TESTING json create") +params = urllib.urlencode({"name":"rhim","uuid":"joprsucks"}) +headers = {"Content-type":"application/json", + "Accept": "application/json"} +conn = httplib.HTTPConnection("localhost", 8080) +conn.request("POST", '/candlepin/user/createtestobject', params, headers) +response = conn.getresponse() +print("Status: %d Response: %s" % (response.status, response.reason)) +rsp = response.read() +conn.close() |