Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_LspServerHandler_cache_file(self):
handler = LspServerHandler(None)
self.load_content_steps('''\
from getgauge.python import step
@step('Vowels in English language are .')
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 reload_steps(file_path, content=None):
pf = PythonFile.parse(file_path, content)
if pf:
registry.remove_steps(file_path)
load_steps(pf)
def after_suite(obj=None):
return _define_wrapper(obj, registry.add_after_suite)