From 12c3d1fe5f6b441badd0c35214fe9e6deff21632 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 22 2017 08:57:29 +0000 Subject: Wrap the raw_input into its own method so we can easily patch it for our tests --- diff --git a/pagure/cli/admin.py b/pagure/cli/admin.py index e9994c4..2c43e3a 100644 --- a/pagure/cli/admin.py +++ b/pagure/cli/admin.py @@ -152,6 +152,11 @@ def _ask_confirmation(): return action.lower() in ['y', 'yes'] +def _get_input(text): + ''' Ask the user for input. ''' + return raw_input(text) + + def do_generate_acl(_): """ Regenerate the gitolite ACL file. @@ -288,7 +293,7 @@ def do_create_admin_token(args): print('%s. %s' % (idx, acl)) print('Which ACLs do you want to associated with this token?') - acls = raw_input('(Conna separated list): ') + acls = _get_input('(Coma separated list): ') acls_idx = [int(acl.strip()) for acl in acls.split(',')] acls = [acls_list[acl] for acl in acls_idx]