Example #1
0
    def test_LspServerHandler_file_list(self):
        handler = LspServerHandler(None)
        req = ImplementationFileListRequest()
        self.fs.create_file(os.path.join(get_step_impl_dir(), 'foo.py'))

        res = handler.GetImplementationFiles(req, None)

        self.assertEqual(os.path.basename(res.implementationFilePaths[0]),
                         'foo.py')
Example #2
0
def _execute_before_suite_hook(request, response, _socket, clear=True):
    if clear:
        registry.clear()
        load_impls(get_step_impl_dir())
    if environ.get('DEBUGGING'):
        ptvsd.enable_attach('',
                            address=('0.0.0.0',
                                     int(environ.get('DEBUG_PORT'))))
        logging.info(ATTACH_DEBUGGER_EVENT)
        ptvsd.wait_for_attach()

    execution_info = create_execution_context_from(
        request.executionStartingRequest.currentExecutionInfo)
    run_hook(request, response, registry.before_suite(), execution_info)
Example #3
0
def _execute_before_suite_hook(request, response, _socket, clear=True):
    if clear:
        registry.clear()
        load_impls(get_step_impl_dir())
    if environ.get('DEBUGGING'):
        ptvsd.enable_attach('', address=('127.0.0.1', int(environ.get('DEBUG_PORT'))))
        logging.info(ATTACH_DEBUGGER_EVENT)
        t = Timer(int(environ.get("debugger_wait_time", 30)), handle_detached)
        t.start()
        ptvsd.wait_for_attach()
        t.cancel()

    execution_info = create_execution_context_from(request.executionStartingRequest.currentExecutionInfo)
    run_hook(request, response, registry.before_suite(), execution_info)
    response.executionStatusResponse.executionResult.message.extend(MessagesStore.pending_messages())
Example #4
0
def _execute_before_suite_hook(request, response, _socket, clear=True):
    if clear:
        registry.clear()
        load_impls(get_step_impl_dir())
    if environ.get('DEBUGGING'):
        ptvsd.enable_attach('',
                            address=('127.0.0.1',
                                     int(environ.get('DEBUG_PORT'))))
        logging.info(ATTACH_DEBUGGER_EVENT)
        signal.signal(signal.SIGALRM, handle_detached)
        signal.alarm(int(environ.get("debugger_wait_time", 30)))
        ptvsd.wait_for_attach()

    execution_info = create_execution_context_from(
        request.executionStartingRequest.currentExecutionInfo)
    run_hook(request, response, registry.before_suite(), execution_info)
Example #5
0
 def GetGlobPatterns(self, request, context):
     res = ImplementationFileGlobPatternResponse()
     res.globPatterns.extend(["{}/**/*.py".format(get_step_impl_dir())])
     return res
Example #6
0
def _glob_pattern(_request, response, _socket):
    patterns = ["{}/**/*.py".format(get_step_impl_dir())]
    return response.implementationFileGlobPatternResponse.globPatterns.extend(
        patterns)