Beispiel #1
0
    def test_Processor_step_position_request(self):

        registry.add_step('Step <a> with <b>', 'func', 'foo.py', {
            'start': 0,
            'startChar': 0,
            'end': 3,
            'endChar': 10
        })
        registry.add_step('Step 1', 'func', 'foo.py', {
            'start': 4,
            'startChar': 0,
            'end': 7,
            'endChar': 10
        })

        request = StepPositionsRequest()
        request.filePath = 'foo.py'

        response = processor.process_step_positions_request(request)

        self.assertTrue(isinstance(response, StepPositionsResponse))
        self.assertEqual('', response.error)

        steps = [(p.stepValue, p.span.start) for p in response.stepPositions]

        self.assertIn(('Step {} with {}', 0), steps)
        self.assertIn(('Step 1', 4), steps)
Beispiel #2
0
    def test_Prcessor_process_step_positions_request(self):
        self.load_content_steps('''\
        @step('foo')
        def foo():
            pass
        ''')

        req = StepPositionsRequest(filePath='foo.py')
        res = processor.process_step_positions_request(req)
        self.assertEqual(res.stepPositions[0].stepValue, 'foo')
Beispiel #3
0
 def GetStepPositions(self, request, context):
     return processor.process_step_positions_request(request)