diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-27 13:08:14 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-27 13:08:14 -0400 |
commit | 0f2f798586d4b680baa20c24086709b9faec9c24 (patch) | |
tree | 1b11a12dc3a773108c47bf898f5a3c03bcd866d7 /tests/test_cmd2.py | |
parent | 19cdd5ff086a7bc8714e011084a1aaecacbf1900 (diff) | |
parent | 86f27ac241c2366022c55e891e449a2ed08b308a (diff) | |
download | cmd2-git-0f2f798586d4b680baa20c24086709b9faec9c24.tar.gz |
Merge branch 'macro' into argparse_conversion
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 707fce49..37a5ed96 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -2002,6 +2002,21 @@ def test_macro_create_with_wrong_arg_count(base_app, capsys): out, err = capsys.readouterr() assert "expects 2 argument(s)" in err +def test_macro_create_with_unicode_numbered_arg(base_app, capsys): + # Create the macro expecting 1 argument + out = run_cmd(base_app, 'macro create fake help {\N{ARABIC-INDIC DIGIT ONE}}') + assert out == normalize("Macro 'fake' created") + + # Run the macro + out = run_cmd(base_app, 'fake') + out, err = capsys.readouterr() + assert "expects 1 argument(s)" in err + +def test_macro_create_with_missing_unicode_arg_nums(base_app, capsys): + run_cmd(base_app, 'macro create fake help {1} {\N{ARABIC-INDIC DIGIT THREE}}') + out, err = capsys.readouterr() + assert "Not all numbers between 1 and 3" in err + def test_macro_list_invalid_macro(base_app, capsys): # Look up invalid macro run_cmd(base_app, 'macro list invalid') |