Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@step('foo1')
def foo():
pass
''')
request.filePath = 'foo.py'
request.status = CacheFileRequest.CLOSED
self.fs.create_file('foo.py', contents=dedent('''\
from getgauge.python import step
@step('foo ')
def foo():
pass
'''))
processor.process_cache_file_request(request)
self.assertEqual(registry.is_implemented('foo1'), False)
self.assertEqual(registry.is_implemented('foo {}'), True)
def test_Processor_cache_file_with_delete_status(self):
request = CacheFileRequest()
self.load_content_steps('''\
from getgauge.python import step
@step('foo1')
def foo():
pass
''')
request.filePath = 'foo.py'
request.status = CacheFileRequest.DELETED
processor.process_cache_file_request(request)
self.assertEqual(registry.is_implemented('foo1'), False)
def test_Processor_cache_file_with_create_status_when_file_is_cached(self):
request = CacheFileRequest()
self.load_content_steps('''\
from getgauge.python import step
@step('foo ')
def foo():
pass
''')
self.assertEqual(registry.is_implemented('foo {}'), True)
request.filePath = 'foo.py'
request.status = CacheFileRequest.CREATED
self.fs.create_file('foo.py')
processor.process_cache_file_request(request)
self.assertEqual(registry.is_implemented('foo {}'), True)
@step('foo1')
def foo():
pass
''')
request.filePath = 'foo.py'
request.content = dedent('''\
from getgauge.python import step
@step('foo ')
def foo():
pass
''')
request.status = CacheFileRequest.OPENED
processor.process_cache_file_request(request)
self.assertEqual(registry.is_implemented('foo1'), False)
self.assertEqual(registry.is_implemented('foo {}'), True)
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)
processor.process_cache_file_request(req)
self.assertTrue(registry.is_implemented('get lost!'))
def test_Processor_cache_file_with_create_status(self):
request = CacheFileRequest()
request.filePath = 'foo.py'
request.status = CacheFileRequest.CREATED
self.fs.create_file('foo.py', contents=dedent('''\
from getgauge.python import step
@step('foo ')
def foo():
pass
'''))
processor.process_cache_file_request(request)
self.assertEqual(registry.is_implemented('foo {}'), True)
@step('foo1')
def foo():
pass
''')
request.filePath = 'foo.py'
request.content = dedent('''\
from getgauge.python import step
@step('foo ')
def foo():
pass
''')
request.status = CacheFileRequest.CHANGED
processor.process_cache_file_request(request)
self.assertEqual(registry.is_implemented('foo1'), False)
self.assertEqual(registry.is_implemented('foo {}'), True)
def CacheFile(self, request, context):
return processor.process_cache_file_request(request)