def test_has_no_named_commands(config): config1 = CommandConfig("command1") config1.anonymous() config.add_command_config(config1) app = ConsoleApplication(config) assert not app.has_named_commands()
def test_get_named_commands(config): config1 = CommandConfig("command1") config2 = CommandConfig("command2") config3 = CommandConfig("command3") config2.anonymous() config3.default() config.add_command_config(config1) config.add_command_config(config2) config.add_command_config(config3) app = ConsoleApplication(config) assert len(app.named_commands) == 2