def Diagnostics_DoesWork_test( app, *args ): with PatchCompleter( DummyCompleter, filetype = 'dummy_filetype' ): diag_data = BuildRequest( contents = 'foo = 5', filetype = 'dummy_filetype' ) response = app.post_json( '/detailed_diagnostic', diag_data ) assert_that( response.json, MessageMatcher( 'detailed diagnostic' ) )
def Subcommands_GetType_Basic_test( app ): RunTest( app, { 'description': 'GetType works on a variable', 'request': { 'command': 'GetType', 'line_num': 17, 'column_num': 1, 'filepath': PathToTestFile( 'test.ts' ), }, 'expect': { 'response': requests.codes.ok, 'data': MessageMatcher( 'var foo: Foo' ) } } )
def test_Subcommands_GetType(self, app): RunTest( app, { 'description': 'GetType works', 'request': { 'command': 'GetType', 'line_num': 14, 'column_num': 1, 'filepath': PathToTestFile('test.js'), }, 'expect': { 'response': requests.codes.ok, 'data': MessageMatcher('var foo: Foo') } })
def Subcommands_GetType_Basic_test(app): filepath = PathToTestFile('test.ts') contents = ReadFile(filepath) event_data = BuildRequest(filepath=filepath, filetype='typescript', contents=contents, event_name='BufferVisit') app.post_json('/event_notification', event_data) gettype_data = BuildRequest(completer_target='filetype_default', command_arguments=['GetType'], line_num=17, column_num=1, contents=contents, filetype='typescript', filepath=filepath) response = app.post_json('/run_completer_command', gettype_data).json assert_that(response, MessageMatcher('var foo: Foo'))