MCPcopy Create free account
hub / github.com/pexpect/pexpect / function_events_callback

Function function_events_callback

tests/test_run.py:38–51  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

36
37
38def function_events_callback(values):
39 try:
40 previous_echoed = (values["child_result_list"][-1]
41 .decode().split("\n")[-2].strip())
42 if previous_echoed.endswith("stage-1"):
43 return "echo stage-2\n"
44 elif previous_echoed.endswith("stage-2"):
45 return "echo stage-3\n"
46 elif previous_echoed.endswith("stage-3"):
47 return "exit\n"
48 else:
49 raise Exception("Unexpected output {0}".format(previous_echoed))
50 except IndexError:
51 return "echo stage-1\n"
52
53
54class RunFuncTestCase(PexpectTestCase.PexpectTestCase):

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…