diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-08-19 14:45:28 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-08-19 15:50:24 -0400 |
commit | 8ba05ef8bcdd53bdd54999cc9885ab310b766d9c (patch) | |
tree | 4a683b34d41710f94e7f259580ceb0ff1f46cc4b /tests_isolated/test_commandset/test_commandset.py | |
parent | df1925db8607b06079ba78d497701ca961b855ab (diff) | |
download | cmd2-git-8ba05ef8bcdd53bdd54999cc9885ab310b766d9c.tar.gz |
set command output now uses SimpleTable.
Tabled tab completion now includes divider row.
Tab completion results for aliases, macros, and Settables wrap long fields.
SimpleTable now accepts blank for the divider character. It is identical to passing None.
Removed --verbose flag from set command so the descriptions always show.
Diffstat (limited to 'tests_isolated/test_commandset/test_commandset.py')
-rw-r--r-- | tests_isolated/test_commandset/test_commandset.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests_isolated/test_commandset/test_commandset.py b/tests_isolated/test_commandset/test_commandset.py index 7e4e1821..89bac976 100644 --- a/tests_isolated/test_commandset/test_commandset.py +++ b/tests_isolated/test_commandset/test_commandset.py @@ -987,9 +987,10 @@ def test_commandset_settables(): # verify the settable shows up out, err = run_cmd(app, 'set') - assert 'arbitrary_value: 5' in out + any(['arbitrary_value' in line and '5' in line for line in out]) + out, err = run_cmd(app, 'set arbitrary_value') - assert out == ['arbitrary_value: 5'] + any(['arbitrary_value' in line and '5' in line for line in out]) # change the value and verify the value changed out, err = run_cmd(app, 'set arbitrary_value 10') @@ -999,7 +1000,7 @@ now: 10 """ assert out == normalize(expected) out, err = run_cmd(app, 'set arbitrary_value') - assert out == ['arbitrary_value: 10'] + any(['arbitrary_value' in line and '10' in line for line in out]) # can't add to cmd2 now because commandset already has this settable with pytest.raises(KeyError): @@ -1058,9 +1059,10 @@ Parameter 'arbitrary_value' not supported (type 'set' for list of parameters). assert 'some.arbitrary_value' in app.settables.keys() out, err = run_cmd(app, 'set') - assert 'some.arbitrary_value: 5' in out + any(['some.arbitrary_value' in line and '5' in line for line in out]) + out, err = run_cmd(app, 'set some.arbitrary_value') - assert out == ['some.arbitrary_value: 5'] + any(['some.arbitrary_value' in line and '5' in line for line in out]) # verify registering a commandset with duplicate prefix and settable names fails with pytest.raises(CommandSetRegistrationError): |