本文整理汇总了Python中sos_testing.check_response函数的典型用法代码示例。如果您正苦于以下问题:Python check_response函数的具体用法?Python check_response怎么用?Python check_response使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_response函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: put_swift
def put_swift(url, token, parsed, conn, cont, obj):
conn.request('PUT',
quote(parsed.path + '/%s' % cont), '',
{'X-Auth-Token': token})
resp = check_response(conn)
resp.read()
conn.request('PUT',
quote(parsed.path + '/%s/%s' % (cont, obj)),
'testbody', {'X-Auth-Token': token, 'Content-Length': '8'})
return check_response(conn)
示例2: put_sos
def put_sos(url, token, parsed, conn, cont):
conn.request('PUT',
quote(parsed.path + '/' + cont), '',
self._db_headers({'X-Auth-Token': token,
'X-TTL': str(60 * 60 * 24)}))
resp = check_response(conn)
resp.read()
示例3: head_sos
def head_sos(url, token, parsed, conn, cont):
conn.request('HEAD',
parsed.path + '/%s' % cont, '',
self._db_headers({'X-Auth-Token': token}))
return check_response(conn)
示例4: delete_swift_obj
def delete_swift_obj(url, token, parsed, conn, cont, obj):
conn.request('DELETE',
quote('/'.join([parsed.path, cont, obj])), '',
headers={'X-Auth-Token': token})
return check_response(conn)
示例5: origin_get
def origin_get(url, token, parsed, conn, cdn_url, obj, headers={}):
cdn_parsed = urlparse(cdn_url)
conn.request('GET',
quote(cdn_parsed.path + '/' + obj), '',
self._origin_headers(headers, cdn_url))
return check_response(conn)
示例6: delete_sos
def delete_sos(url, token, parsed, conn, cont):
conn.request('DELETE',
quote('/'.join([parsed.path, cont])), '',
headers=self._db_headers({'X-Auth-Token': token}))
return check_response(conn)
示例7: get_sos_marker
def get_sos_marker(url, token, parsed, conn, output_format,
cdn_enabled=''):
conn.request('GET',
parsed.path + '?marker=%s' % quote(unitest.encode('utf8')), '',
self._db_headers({'X-Auth-Token': token}))
return check_response(conn)
示例8: get_sos
def get_sos(url, token, parsed, conn, output_format, cdn_enabled=''):
conn.request('GET', parsed.path + '?format=%s&enabled=%s' %
(output_format, cdn_enabled), '',
self._db_headers({'X-Auth-Token': token}))
return check_response(conn)
示例9: head_swift
def head_swift(url, token, parsed, conn, cont, obj):
conn.request('HEAD',
quote(parsed.path + '/%s/%s' % (cont, obj)), '',
{'X-Auth-Token': token})
return check_response(conn)
示例10: origin_options
def origin_options(url, token, parsed, conn, cdn_url, obj, headers={}):
cdn_parsed = urlparse(cdn_url)
conn.request('OPTIONS',
quote(cdn_parsed.path + '/' + obj), '',
self._origin_headers(headers, cdn_url))
return check_response(conn, allow_401=True)
示例11: get_info
def get_info(url, token, parsed, conn):
conn.request('GET', '/info')
return check_response(conn)