diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-08-27 13:19:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 13:19:23 -0400 |
commit | f4943a904efba05c13eb930b4a4535c19429c72c (patch) | |
tree | cbaff855e2d73f1d86ae1230f32770e31c62ad6b /tests/test_argparse_custom.py | |
parent | 97c348c599d8fa963553593e5c19fb100b85e313 (diff) | |
parent | 478ea83336a4d1659ad06ef365db3dc5e051e46d (diff) | |
download | cmd2-git-f4943a904efba05c13eb930b4a4535c19429c72c.tar.gz |
Merge pull request #985 from python-cmd2/dynamic_value
Added Cmd2AttributeWrapper class
Diffstat (limited to 'tests/test_argparse_custom.py')
-rw-r--r-- | tests/test_argparse_custom.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_argparse_custom.py b/tests/test_argparse_custom.py index 3ce90118..e2b3bb97 100644 --- a/tests/test_argparse_custom.py +++ b/tests/test_argparse_custom.py @@ -267,3 +267,13 @@ def test_apcustom_metavar_tuple(): parser = Cmd2ArgumentParser() parser.add_argument('--aflag', nargs=2, metavar=('foo', 'bar'), help='This is a test') assert '[--aflag foo bar]' in parser.format_help() + + +def test_cmd2_attribute_wrapper(): + initial_val = 5 + wrapper = cmd2.Cmd2AttributeWrapper(initial_val) + assert wrapper.get() == initial_val + + new_val = 22 + wrapper.set(new_val) + assert wrapper.get() == new_val |