Commit d5a7583f authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Titouan Soulard

test_slapconfiguration: improve request Handler

parent f9463b47
......@@ -10,6 +10,7 @@ from slapos.recipe import slapconfiguration
from slapos import format as slapformat
from slapos.grid.SlapObject import SOFTWARE_INSTANCE_JSON_FILENAME
from slapos.util import dumps, calculate_dict_hash
from slapos.slap.slap import json_loads_byteified
class APIRequestHandler(object):
......@@ -26,10 +27,9 @@ class APIRequestHandler(object):
self.sequence_list.append(url.path)
if not self.response_list and self.response_list[0][0] != url.path:
if not self.response_list or self.response_list[0][0] != url.path:
raise ValueError("Unexcpected call: %s %s" % (url.path, req.body))
self.request_payload_list.append(req.body)
self.request_payload_list.append(json_loads_byteified(req.body))
return self.response_list.pop(0)[1]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment