def test_LspServerHandler_cache_file(self): handler = LspServerHandler(None) self.load_content_steps('''\ from getgauge.python import step @step('Vowels in English language are <aeiou>.') def foo(vowels): print(vowels) ''') self.assertTrue(registry.is_implemented( 'Vowels in English language are {}.')) content = dedent('''\ from getgauge.python import step @step('get lost!') def foo(): pass ''') req = CacheFileRequest( content=content, filePath='foo.py', status=CacheFileRequest.CHANGED) handler.CacheFile(req, None) self.assertTrue(registry.is_implemented('get lost!'))
def test_LspServerHandler_cache_file(self): handler = LspServerHandler(None) content = "from getgauge.python import step\n\n" \ "@step('Vowels in English language are <aeiou>.')\n" \ "def foo(vowels):" \ "\tprint(vowels)" loader.load_steps(content, 'foo.py') self.assertTrue( registry.is_implemented('Vowels in English language are {}.')) content = "from getgauge.python import step\n\n" \ "@step('get lost!')\n" \ "def foo():" \ "\tpass" req = CacheFileRequest( **{ 'content': content, 'filePath': 'foo.py', 'status': CacheFileRequest.CHANGED }) handler.CacheFile(req, None) self.assertTrue(registry.is_implemented('get lost!'))