mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 19:07:36 -02:30
HTTP delete operational, though we'll soon override this anyway
This commit is contained in:
@@ -36,8 +36,9 @@ def update_item(item, data, expect=200):
|
|||||||
return resp
|
return resp
|
||||||
|
|
||||||
def delete(url_seg, expect=204):
|
def delete(url_seg, expect=204):
|
||||||
print "DELETING: %s" % url_seg
|
if not url_seg.endswith("/"):
|
||||||
resp = requests.delete("%s/%s" % (server, url_seg), auth=AUTH, headers=HEADERS)
|
url_seg = "%s/" % url_seg
|
||||||
|
resp = requests.delete("%s%s" % (server, url_seg), auth=AUTH, headers=HEADERS)
|
||||||
if resp.status_code != expect:
|
if resp.status_code != expect:
|
||||||
assert "DELETE: Expecting %s got %s: %s" % (expect, resp.status_code, resp.text)
|
assert "DELETE: Expecting %s got %s: %s" % (expect, resp.status_code, resp.text)
|
||||||
return resp
|
return resp
|
||||||
@@ -49,9 +50,9 @@ class Collection(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
self.response = get(self.base_url())
|
self.response = get(self.base_url())
|
||||||
print "---"
|
#print "---"
|
||||||
print self.response.text
|
#print self.response.text
|
||||||
print "---"
|
#print "---"
|
||||||
try:
|
try:
|
||||||
self.data = json.loads(self.response.text)
|
self.data = json.loads(self.response.text)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|||||||
Reference in New Issue
Block a user