diff options
author | kotfu <jared@kotfu.net> | 2018-05-07 21:22:55 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-07 21:22:55 -0600 |
commit | cc455576abf40dab1fe80be0099a97c7c8207e16 (patch) | |
tree | 02ebd8a9c21490117a3ad81e7ed2438bea94f17f /tests/test_cmd2.py | |
parent | 5e6a929613e1a2ff0542109913463c4264fbd11c (diff) | |
parent | a4962abeda0ebf5815dafec99a1bd7bd1cdb8a4e (diff) | |
download | cmd2-git-cc455576abf40dab1fe80be0099a97c7c8207e16.tar.gz |
Merge pull request #391 from python-cmd2/ignore_identchars
Remove check on self.identchars in do_alias()
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 0da7e9d5..bc76505f 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1688,12 +1688,6 @@ def test_alias_lookup_invalid_alias(base_app, capsys): out, err = capsys.readouterr() assert "not found" in err -def test_alias_with_invalid_name(base_app, capsys): - run_cmd(base_app, 'alias @ help') - out, err = capsys.readouterr() - assert "can only contain the following characters" in err - - def test_unalias(base_app): # Create an alias run_cmd(base_app, 'alias fake pyscript') @@ -1711,6 +1705,18 @@ def test_unalias_non_existing(base_app, capsys): out, err = capsys.readouterr() assert "does not exist" in err +@pytest.mark.parametrize('alias_name', [ + '">"', + '"no>pe"', + '"no spaces"', + '"nopipe|"', + '"noterm;"', + 'noembedded"quotes', +]) +def test_create_invalid_alias(base_app, alias_name, capsys): + run_cmd(base_app, 'alias {} help'.format(alias_name)) + out, err = capsys.readouterr() + assert "can not contain" in err def test_ppaged(base_app): msg = 'testing...' |