mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
tests: Reach 100% coverage for zerver/liv/management.py.
Cleaned up add_user_list_args(). The "help" and "all_users_help" have all default values. As noted in an earlier commit, "all_users_help" is always passed in, so we can get rid of "all_users_arg". We keep the default for "all_users_help" so we don't have to change variable order in function definition.
This commit is contained in:
@@ -44,28 +44,20 @@ You can use the command list_realms to find ID of the realms in this server."""
|
||||
help=help)
|
||||
|
||||
def add_user_list_args(self, parser: ArgumentParser,
|
||||
help: Optional[str]=None,
|
||||
all_users_arg: bool=True,
|
||||
all_users_help: Optional[str]=None) -> None:
|
||||
if help is None:
|
||||
help = 'A comma-separated list of email addresses.'
|
||||
|
||||
help: str='A comma-separated list of email addresses.',
|
||||
all_users_help: str="All users in realm.") -> None:
|
||||
parser.add_argument(
|
||||
'-u', '--users',
|
||||
dest='users',
|
||||
type=str,
|
||||
help=help)
|
||||
|
||||
if all_users_arg:
|
||||
if all_users_help is None:
|
||||
all_users_help = "All users in realm."
|
||||
|
||||
parser.add_argument(
|
||||
'-a', '--all-users',
|
||||
dest='all_users',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=all_users_help)
|
||||
parser.add_argument(
|
||||
'-a', '--all-users',
|
||||
dest='all_users',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=all_users_help)
|
||||
|
||||
def get_realm(self, options: Dict[str, Any]) -> Optional[Realm]:
|
||||
val = options["realm_id"]
|
||||
|
||||
Reference in New Issue
Block a user