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_loader_triple_quote_strings(self):
content = dedent("""
@step('''print hello <>''')
def printf(arg1):
print(arg1)
""")
load_steps(PythonFile.parse("foo.py", content))
self.assertTrue(registry.is_implemented("print hello {}"))
def test_loader_reload_registry_for_given_content(self):
content = dedent("""
@step("print hello")
def printf():
print("hello")
""")
load_steps(PythonFile.parse("foo.py", content))
self.assertTrue(registry.is_implemented("print hello"))
content = dedent("""
@step("print world")
def printf():
print("hello")
""")
reload_steps('foo.py', content)
self.assertFalse(registry.is_implemented("print hello"))
self.assertTrue(registry.is_implemented("print world"))
def load_content_steps(self, content):
content = dedent(content)
pf = PythonFile.parse("foo.py", content)
self.assertIsNotNone(pf)
loader.load_steps(pf)
def load_content_steps(self, content):
content = dedent(content)
pf = PythonFile.parse("foo.py", content)
self.assertIsNotNone(pf)
loader.load_steps(pf)
def load_content_steps(self, content):
content = dedent(content)
pf = PythonFile.parse("foo.py", content)
self.assertIsNotNone(pf)
loader.load_steps(pf)