MCPcopy
hub / github.com/ray-project/ray / check_output

Method check_output

python/ray/tests/autoscaler_test_utils.py:73–90  ·  view source on GitHub ↗
(self, cmd)

Source from the content-addressed store, hash-verified

71 raise CalledProcessError(1, token, "Failing command on purpose")
72
73 def check_output(self, cmd):
74 with self.lock:
75 self.check_call(cmd)
76 return_string = "command-output"
77 key_to_shrink = None
78 for pattern, response_list in self.call_response.items():
79 if pattern in str(cmd):
80 return_string = response_list[0]
81 key_to_shrink = pattern
82 break
83 if key_to_shrink:
84 self.call_response[key_to_shrink] = self.call_response[key_to_shrink][
85 1:
86 ]
87 if len(self.call_response[key_to_shrink]) == 0:
88 del self.call_response[key_to_shrink]
89
90 return return_string.encode()
91
92 def assert_has_call(
93 self, ip: str, pattern: Optional[str] = None, exact: Optional[List[str]] = None

Calls 3

check_callMethod · 0.95
itemsMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected