MCPcopy Create free account
hub / github.com/microsoft/debugpy / Response

Function Response

tests/timeline.py:809–839  ·  view source on GitHub ↗
(request, body=some.object)

Source from the content-addressed store, hash-verified

807
808
809def Response(request, body=some.object):
810 assert isinstance(request, Expectation) or isinstance(request, RequestOccurrence)
811
812 exp = PatternExpectation("response", request, body)
813 exp.timeline = request.timeline
814 exp.has_lower_bound = request.has_lower_bound
815
816 # Try to be as specific as possible.
817 if isinstance(request, Expectation):
818 if request.circumstances[0] != "request":
819 exp.describe = lambda: f"response to {request!r}"
820 return
821 else:
822 items = (("command", request.circumstances[1]),)
823 else:
824 items = (("command", request.command),)
825
826 if isinstance(request, Occurrence):
827 items += (("request_seq", request.seq),)
828
829 if body is some.object:
830 items += (("\002...", "...\003"),)
831 elif body is some.error or body == some.error:
832 items += (("success", False),)
833 if body == some.error:
834 items += (("message", str(body)),)
835 else:
836 items += (("body", body),)
837
838 exp.describe = lambda: _describe_message("response", *items)
839 return exp
840
841
842class Occurrence(Expectation):

Callers 2

test_request_responseFunction · 0.90
wait_for_responseMethod · 0.70

Calls 2

PatternExpectationClass · 0.85
_describe_messageFunction · 0.85

Tested by 1

test_request_responseFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…