summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_argparse.py18
-rw-r--r--tests/test_argparse_completer.py8
-rw-r--r--tests/test_completion.py36
3 files changed, 31 insertions, 31 deletions
diff --git a/tests/test_argparse.py b/tests/test_argparse.py
index 74a5d16f..e5fa6dd0 100644
--- a/tests/test_argparse.py
+++ b/tests/test_argparse.py
@@ -192,31 +192,31 @@ def test_preservelist(argparse_app):
class SubcommandApp(cmd2.Cmd):
- """ Example cmd2 application where we a base command which has a couple sub-commands."""
+ """ Example cmd2 application where we a base command which has a couple subcommands."""
def __init__(self):
cmd2.Cmd.__init__(self)
- # sub-command functions for the base command
+ # subcommand functions for the base command
def base_foo(self, args):
- """foo sub-command of base command"""
+ """foo subcommand of base command"""
self.poutput(args.x * args.y)
def base_bar(self, args):
- """bar sub-command of base command"""
+ """bar subcommand of base command"""
self.poutput('((%s))' % args.z)
# create the top-level parser for the base command
base_parser = argparse.ArgumentParser(prog='base')
- base_subparsers = base_parser.add_subparsers(title='sub-commands', help='sub-command help')
+ base_subparsers = base_parser.add_subparsers(title='subcommands', help='subcommand help')
- # create the parser for the "foo" sub-command
+ # create the parser for the "foo" subcommand
parser_foo = base_subparsers.add_parser('foo', help='foo help')
parser_foo.add_argument('-x', type=int, default=1, help='integer')
parser_foo.add_argument('y', type=float, help='float')
parser_foo.set_defaults(func=base_foo)
- # create the parser for the "bar" sub-command
+ # create the parser for the "bar" subcommand
parser_bar = base_subparsers.add_parser('bar', help='bar help')
parser_bar.add_argument('z', help='string')
parser_bar.set_defaults(func=base_bar)
@@ -226,10 +226,10 @@ class SubcommandApp(cmd2.Cmd):
"""Base command help"""
func = getattr(args, 'func', None)
if func is not None:
- # Call whatever sub-command function was selected
+ # Call whatever subcommand function was selected
func(self, args)
else:
- # No sub-command was provided, so call help
+ # No subcommand was provided, so call help
self.do_help('base')
@pytest.fixture
diff --git a/tests/test_argparse_completer.py b/tests/test_argparse_completer.py
index daddf0dd..d1e115d4 100644
--- a/tests/test_argparse_completer.py
+++ b/tests/test_argparse_completer.py
@@ -65,14 +65,14 @@ class AutoCompleteTester(cmd2.Cmd):
# Top level parser for music command
music_parser = Cmd2ArgumentParser(description='Manage music', prog='music')
- # Add sub-commands to music
+ # Add subcommands to music
music_subparsers = music_parser.add_subparsers()
# music -> create
music_create_parser = music_subparsers.add_parser('create', help='Create music')
music_create_parser.set_defaults(func=_music_create)
- # Add sub-commands to music -> create
+ # Add subcommands to music -> create
music_create_subparsers = music_create_parser.add_subparsers()
# music -> create -> jazz
@@ -88,10 +88,10 @@ class AutoCompleteTester(cmd2.Cmd):
"""Music command"""
func = getattr(args, 'func', None)
if func is not None:
- # Call whatever sub-command function was selected
+ # Call whatever subcommand function was selected
func(self, args)
else:
- # No sub-command was provided, so call help
+ # No subcommand was provided, so call help
# noinspection PyTypeChecker
self.do_help('music')
diff --git a/tests/test_completion.py b/tests/test_completion.py
index 233783c6..59fe04d1 100644
--- a/tests/test_completion.py
+++ b/tests/test_completion.py
@@ -1030,7 +1030,7 @@ def test_cmd2_help_subcommand_completion_nomatch(sc_app):
assert first_match is None
def test_subcommand_tab_completion(sc_app):
- # This makes sure the correct completer for the sport sub-command is called
+ # This makes sure the correct completer for the sport subcommand is called
text = 'Foot'
line = 'base sport {}'.format(text)
endidx = len(line)
@@ -1043,8 +1043,8 @@ def test_subcommand_tab_completion(sc_app):
def test_subcommand_tab_completion_with_no_completer(sc_app):
- # This tests what happens when a sub-command has no completer
- # In this case, the foo sub-command has no completer defined
+ # This tests what happens when a subcommand has no completer
+ # In this case, the foo subcommand has no completer defined
text = 'Foot'
line = 'base foo {}'.format(text)
endidx = len(line)
@@ -1071,42 +1071,42 @@ def test_subcommand_tab_completion_space_in_text(sc_app):
class SubcommandsWithUnknownExample(cmd2.Cmd):
"""
- Example cmd2 application where we a base command which has a couple sub-commands
- and the "sport" sub-command has tab completion enabled.
+ Example cmd2 application where we a base command which has a couple subcommands
+ and the "sport" subcommand has tab completion enabled.
"""
def __init__(self):
cmd2.Cmd.__init__(self)
- # sub-command functions for the base command
+ # subcommand functions for the base command
def base_foo(self, args):
- """foo sub-command of base command"""
+ """foo subcommand of base command"""
self.poutput(args.x * args.y)
def base_bar(self, args):
- """bar sub-command of base command"""
+ """bar subcommand of base command"""
self.poutput('((%s))' % args.z)
def base_sport(self, args):
- """sport sub-command of base command"""
+ """sport subcommand of base command"""
self.poutput('Sport is {}'.format(args.sport))
# create the top-level parser for the base command
base_parser = argparse.ArgumentParser(prog='base')
- base_subparsers = base_parser.add_subparsers(title='sub-commands', help='sub-command help')
+ base_subparsers = base_parser.add_subparsers(title='subcommands', help='subcommand help')
- # create the parser for the "foo" sub-command
+ # create the parser for the "foo" subcommand
parser_foo = base_subparsers.add_parser('foo', help='foo help')
parser_foo.add_argument('-x', type=int, default=1, help='integer')
parser_foo.add_argument('y', type=float, help='float')
parser_foo.set_defaults(func=base_foo)
- # create the parser for the "bar" sub-command
+ # create the parser for the "bar" subcommand
parser_bar = base_subparsers.add_parser('bar', help='bar help')
parser_bar.add_argument('z', help='string')
parser_bar.set_defaults(func=base_bar)
- # create the parser for the "sport" sub-command
+ # create the parser for the "sport" subcommand
parser_sport = base_subparsers.add_parser('sport', help='sport help')
sport_arg = parser_sport.add_argument('sport', help='Enter name of a sport', choices=sport_item_strs)
@@ -1115,10 +1115,10 @@ class SubcommandsWithUnknownExample(cmd2.Cmd):
"""Base command help"""
func = getattr(args, 'func', None)
if func is not None:
- # Call whatever sub-command function was selected
+ # Call whatever subcommand function was selected
func(self, args)
else:
- # No sub-command was provided, so call help
+ # No subcommand was provided, so call help
self.do_help('base')
@@ -1222,7 +1222,7 @@ def test_cmd2_help_subcommand_completion_nomatch_scu(scu_app):
def test_subcommand_tab_completion_scu(scu_app):
- # This makes sure the correct completer for the sport sub-command is called
+ # This makes sure the correct completer for the sport subcommand is called
text = 'Foot'
line = 'base sport {}'.format(text)
endidx = len(line)
@@ -1235,8 +1235,8 @@ def test_subcommand_tab_completion_scu(scu_app):
def test_subcommand_tab_completion_with_no_completer_scu(scu_app):
- # This tests what happens when a sub-command has no completer
- # In this case, the foo sub-command has no completer defined
+ # This tests what happens when a subcommand has no completer
+ # In this case, the foo subcommand has no completer defined
text = 'Foot'
line = 'base foo {}'.format(text)
endidx = len(line)