def execute_subcommand(config, subcommand): """Execute subcommand.""" command_module = getattr(molecule.command, subcommand) command = getattr(command_module, text.camelize(subcommand)) # knowledge of the current action is used by some provisioners # to ensure they behave correctly during certain sequence steps, # particulary the setting of ansible options in create/destroy, # and is also used for reporting in execute_cmdline_scenarios config.action = subcommand return command(config).execute()
def test_camelize(): assert "Foo" == camelize("foo") assert "FooBar" == camelize("foo_bar") assert "FooBarBaz" == camelize("foo_bar_baz")