How to use the getgauge.parser.PythonFile.parse function in getgauge

To help you get started, we’ve selected a few getgauge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getgauge / gauge-python / tests / test_static_loader.py View on Github external
def test_loader_populates_registry_only_with_steps_from_given_file_content(self):
        content = dedent("""
        @step("print hello")
        def printf():
            print("hello")


        @hello("some other decorator")
        @step("print .")
        def print_word(word):
            print(word)

        """)
        load_steps(PythonFile.parse("foo.py", content))

        self.assertTrue(registry.is_implemented("print hello"))
        self.assertTrue(registry.is_implemented("print {}."))
        self.assertFalse(registry.is_implemented("some other decorator"))