Example #1
0
    def test_LspServerHandler_validate_step(self):
        handler = LspServerHandler(None)
        content = "@step('foo')\ndef foo():\n\tpass\n"
        ast = loader.generate_ast(content, 'foo.py')
        loader.load_steps(ast, 'foo.py')
        step_value = ProtoStepValue(**{'stepValue': 'foo', 'parameterizedStepValue': 'foo'})

        req = StepValidateRequest(**{'stepText': 'foo', 'stepValue': step_value, 'numberOfParameters': 0})
        res = handler.ValidateStep(req, None)
        self.assertTrue(res.isValid)
Example #2
0
    def test_LspServerHandler_validate_step(self):
        handler = LspServerHandler(None)
        self.load_content_steps('''\
        @step('foo')
        def foo():
            pass
        ''')
        step_value = ProtoStepValue(
            stepValue='foo', parameterizedStepValue='foo')

        req = StepValidateRequest(
            stepText='foo', stepValue=step_value, numberOfParameters=0)
        res = handler.ValidateStep(req, None)
        self.assertTrue(res.isValid)