(self, expected_class, accept_message=lambda obj: True)
| 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: |
no test coverage detected