def test_has_default_commands(config): config1 = CommandConfig("command1") config1.default() config.add_command_config(config1) app = ConsoleApplication(config) assert app.has_default_commands()
def test_get_default_commands(config): config1 = CommandConfig("command1") config2 = CommandConfig("command2") config3 = CommandConfig("command3") config2.default() config3.default() config.add_command_config(config1) config.add_command_config(config2) config.add_command_config(config3) app = ConsoleApplication(config) assert len(app.default_commands) == 2