From c14c62caaec604ac9b5505fc10aab8c81e9eef02 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Aug 24 2021 14:57:28 +0000 Subject: PR#2995: fix "an user" -> "a user" grammar in help text and errors Merges #2995 https://pagure.io/koji/pull-request/2995 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 39b4c48..19b3a0e 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -7978,7 +7978,7 @@ def handle_version(goptions, session, args): def anon_handle_userinfo(goptions, session, args): - """[admin] Show information about an user""" + """[admin] Show information about a user""" usage = _("usage: %prog userinfo [options] [ ...]") parser = OptionParser(usage=get_usage_str(usage)) (options, args) = parser.parse_args(args) diff --git a/hub/kojihub.py b/hub/kojihub.py index 3f50c1f..f7efcc4 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -8706,7 +8706,7 @@ def add_group_member(group, user, strict=True): if not ginfo or ginfo['usertype'] != koji.USERTYPES['GROUP']: raise koji.GenericError("Not a group: %s" % group) if not uinfo: - raise koji.GenericError("Not an user: %s" % user) + raise koji.GenericError("Not a user: %s" % user) if uinfo['usertype'] == koji.USERTYPES['GROUP']: raise koji.GenericError("Groups cannot be members of other groups") # check to see if user is already a member diff --git a/tests/test_cli/data/list-commands-admin.txt b/tests/test_cli/data/list-commands-admin.txt index 58f9b83..109ed8e 100644 --- a/tests/test_cli/data/list-commands-admin.txt +++ b/tests/test_cli/data/list-commands-admin.txt @@ -67,7 +67,7 @@ admin commands: unblock-group-req Unblock a group's requirement listing unblock-pkg Unblock a package in the listing for tag unlock-tag Unlock a tag - userinfo Show information about an user + userinfo Show information about a user write-signed-rpm Write signed RPMs to disk Try "{progname} --help" for help about global options diff --git a/tests/test_cli/data/list-commands.txt b/tests/test_cli/data/list-commands.txt index 99ae111..833f502 100644 --- a/tests/test_cli/data/list-commands.txt +++ b/tests/test_cli/data/list-commands.txt @@ -67,7 +67,7 @@ admin commands: unblock-group-req Unblock a group's requirement listing unblock-pkg Unblock a package in the listing for tag unlock-tag Unlock a tag - userinfo Show information about an user + userinfo Show information about a user write-signed-rpm Write signed RPMs to disk bind commands: diff --git a/tests/test_hub/test_add_group_member.py b/tests/test_hub/test_add_group_member.py index 4281216..114a158 100644 --- a/tests/test_hub/test_add_group_member.py +++ b/tests/test_hub/test_add_group_member.py @@ -25,7 +25,7 @@ class TestAddGroupMember(unittest.TestCase): self.get_user.side_effect = data with self.assertRaises(koji.GenericError) as cm: self.exports.addGroupMember(group, username) - self.assertEqual("Not an user: %s" % username, str(cm.exception)) + self.assertEqual("Not a user: %s" % username, str(cm.exception)) def test_non_exist_group(self): data = [None,