Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)
def test_looks_like_flag():
from cmd2.argparse_completer import _looks_like_flag
parser = Cmd2ArgumentParser()
# Does not start like a flag
assert not _looks_like_flag('', parser)
assert not _looks_like_flag('non-flag', parser)
assert not _looks_like_flag('-', parser)
assert not _looks_like_flag('--has space', parser)
assert not _looks_like_flag('-2', parser)
# Does start like a flag
assert _looks_like_flag('--', parser)
assert _looks_like_flag('-flag', parser)
assert _looks_like_flag('--flag', parser)