MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / wait_for_json_message

Method wait_for_json_message

tests_python/test_debugger_json.py:102–116  ·  view source on GitHub ↗
(self, expected_class, accept_message=lambda obj: True)

Source from the content-addressed store, hash-verified

100 return ret
101
102 def wait_for_json_message(self, expected_class, accept_message=lambda obj: True):
103
104 def accept_json_message(msg):
105 if msg.startswith("{"):
106 decoded_msg = from_json(msg)
107
108 self._all_json_messages_found.append(_MessageWithMark(decoded_msg))
109
110 if isinstance(decoded_msg, expected_class):
111 if accept_message(decoded_msg):
112 return True
113 return False
114
115 msg = self.writer.wait_for_message(accept_json_message, unquote_msg=False, expect_xml=False)
116 return from_json(msg)
117
118 def build_accept_response(self, request, response_class=None):
119 if response_class is None:

Calls 2

from_jsonFunction · 0.90
wait_for_messageMethod · 0.80

Tested by

no test coverage detected