MCPcopy Create free account
hub / github.com/ycm-core/YouCompleteMe / MockResolveRequest

Function MockResolveRequest

python/ycm/tests/completion_test.py:58–69  ·  view source on GitHub ↗

Mock out the CompletionRequest, replacing the response handler JsonFromFuture with the |response_method| parameter.

( response_method )

Source from the content-addressed store, hash-verified

56
57@contextlib.contextmanager
58def MockResolveRequest( response_method ):
59 """Mock out the CompletionRequest, replacing the response handler
60 JsonFromFuture with the |response_method| parameter."""
61
62 with patch( 'ycm.client.resolve_completion_request.ResolveCompletionRequest.'
63 'PostDataToHandlerAsync',
64 return_value = MagicMock( return_value=True ) ):
65
66 # We set up a fake response.
67 with patch( 'ycm.client.base_request._JsonFromFuture',
68 side_effect = response_method ):
69 yield
70
71
72class CompletionTest( TestCase ):

Calls

no outgoing calls

Tested by

no test coverage detected