Test out py26 with new HTTPretty
This commit is contained in:
parent
fe1f3ec06c
commit
3bddbb4af3
23 changed files with 81 additions and 68 deletions
|
|
@ -14,23 +14,21 @@ class ElasticMapReduceResponse(BaseResponse):
|
|||
return [value[0] for key, value in self.querystring.items() if key.startswith(param_prefix)]
|
||||
|
||||
def _get_dict_param(self, param_prefix):
|
||||
return {
|
||||
camelcase_to_underscores(key.replace(param_prefix, "")): value[0]
|
||||
for key, value
|
||||
in self.querystring.items()
|
||||
if key.startswith(param_prefix)
|
||||
}
|
||||
params = {}
|
||||
for key, value in self.querystring.items():
|
||||
if key.startswith(param_prefix):
|
||||
params[camelcase_to_underscores(key.replace(param_prefix, ""))] = value[0]
|
||||
return params
|
||||
|
||||
def _get_list_prefix(self, param_prefix):
|
||||
results = []
|
||||
param_index = 1
|
||||
while True:
|
||||
index_prefix = "{}.{}.".format(param_prefix, param_index)
|
||||
new_items = {
|
||||
camelcase_to_underscores(key.replace(index_prefix, "")): value[0]
|
||||
for key, value in self.querystring.items()
|
||||
if key.startswith(index_prefix)
|
||||
}
|
||||
index_prefix = "{0}.{1}.".format(param_prefix, param_index)
|
||||
new_items = {}
|
||||
for key, value in self.querystring.items():
|
||||
if key.startswith(index_prefix):
|
||||
new_items[camelcase_to_underscores(key.replace(index_prefix, ""))] = value[0]
|
||||
if not new_items:
|
||||
break
|
||||
results.append(new_items)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue