Test out py26 with new HTTPretty

This commit is contained in:
Steve Pulec 2013-10-03 20:34:13 -04:00
commit 3bddbb4af3
23 changed files with 81 additions and 68 deletions

View file

@ -46,7 +46,7 @@ class BaseResponse(object):
status = new_headers.pop('status', 200)
headers.update(new_headers)
return status, headers, body
raise NotImplementedError("The {} action has not been implemented".format(action))
raise NotImplementedError("The {0} action has not been implemented".format(action))
def metadata_response(request, full_url, headers):

View file

@ -31,7 +31,7 @@ def get_random_hex(length=8):
def get_random_message_id():
return '{}-{}-{}-{}-{}'.format(get_random_hex(8), get_random_hex(4), get_random_hex(4), get_random_hex(4), get_random_hex(12))
return '{0}-{1}-{2}-{3}-{4}'.format(get_random_hex(8), get_random_hex(4), get_random_hex(4), get_random_hex(4), get_random_hex(12))
def convert_regex_to_flask_path(url_path):
@ -61,7 +61,7 @@ class convert_flask_to_httpretty_response(object):
outer = self.callback.im_class.__name__
else:
outer = self.callback.__module__
return "{}.{}".format(outer, self.callback.__name__)
return "{0}.{1}".format(outer, self.callback.__name__)
def __call__(self, args=None, **kwargs):
headers = dict(request.headers)