Load response when loading iteration
This commit is contained in:
@@ -28,14 +28,18 @@ class IterationParser:
|
||||
"""
|
||||
root = ET.fromstring(content)
|
||||
context_elem = root.find("context")
|
||||
response_elem = root.find("response")
|
||||
|
||||
if context_elem is None:
|
||||
raise ValueError("Invalid iteration file - missing context")
|
||||
|
||||
context = ET.fromstring(context_elem.text)
|
||||
if response_elem is None:
|
||||
raise ValueError("Invalid iteration file - missing response")
|
||||
|
||||
context = context_elem.text.strip()
|
||||
response = response_elem.text.strip()
|
||||
|
||||
entries = []
|
||||
for elem in context:
|
||||
for elem in ET.fromstring(context):
|
||||
if elem.tag == "background":
|
||||
entries.append(IterationParser._parse_background(elem, work_dir))
|
||||
elif elem.tag == "parse_error":
|
||||
@@ -51,7 +55,7 @@ class IterationParser:
|
||||
elif elem.tag == "write_stdout":
|
||||
entries.append(IterationParser._parse_write(elem, io_buffer))
|
||||
|
||||
return entries
|
||||
return (context, response, entries)
|
||||
|
||||
@staticmethod
|
||||
def _parse_background(elem: ET.Element, work_dir: Path) -> BackgroundEntry:
|
||||
|
||||
Reference in New Issue
Block a user