From f66bb81a85f335397778ae7c066cde466f4a64cf Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: Tue, 22 Oct 2019 10:43:44 +0000 Subject: [PATCH] cli: fix typo in edit-user cmd fixes: #862 --- cli/koji_cli/commands.py | 2 +- tests/test_cli/test_edit_user.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 681b4eeb..efe43e2f 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -2083,7 +2083,7 @@ def handle_edit_user(goptions, session, args): princ_mappings = [] for p in options.edit_krb: old, new = p.split('=', 1) - princ_mappings.append({'old': arg_filter(old), 'new': arg_filter(old)}) + princ_mappings.append({'old': arg_filter(old), 'new': arg_filter(new)}) for a in options.add_krb: princ_mappings.append({'old': None, 'new': arg_filter(a)}) for r in options.remove_krb: diff --git a/tests/test_cli/test_edit_user.py b/tests/test_cli/test_edit_user.py index c3ee1dd4..7f561166 100644 --- a/tests/test_cli/test_edit_user.py +++ b/tests/test_cli/test_edit_user.py @@ -43,7 +43,7 @@ class TestEditUser(unittest.TestCase): # Finally, assert that things were called as we expected. activate_session_mock.assert_called_once_with(session, options) session.editUser.assert_called_once_with(user, rename, - [{'new': 'oldkrb', 'old': 'oldkrb'}, + [{'new': 'newkrb', 'old': 'oldkrb'}, {'new': 'addedkrb', 'old': None}, {'new': None, 'old': 'removedkrb'}]) self.assertEqual(rv, None)