diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-10-09 20:04:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-09 20:04:50 -0400 |
commit | f38e100fd77f4a136a4883d23b2f4f8b3cd934b7 (patch) | |
tree | c289c216807646567953191d35ebdc5c07198c24 /tests/test_utils.py | |
parent | 467be57e647112f536becc8625ffa080cb67a0ce (diff) | |
parent | 84f290bfdd82eb1c2eaf26b5936f7088b4911f2c (diff) | |
download | cmd2-git-f38e100fd77f4a136a4883d23b2f4f8b3cd934b7.tar.gz |
Merge pull request #571 from python-cmd2/argparse_remainder
Fixes related to handling of argparse.REMAINDER
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r-- | tests/test_utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 43a05a9a..807bc0fd 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -119,11 +119,23 @@ def stdout_sim(): stdsim = cu.StdSim(sys.stdout) return stdsim +@pytest.fixture +def stringio_sim(): + import io + stdsim = cu.StdSim(io.StringIO(), echo=True) + return stdsim + + def test_stdsim_write_str(stdout_sim): my_str = 'Hello World' stdout_sim.write(my_str) assert stdout_sim.getvalue() == my_str +def test_stdsim_write_str_inner_no_buffer(stringio_sim): + my_str = 'Hello World' + stringio_sim.write(my_str) + assert stringio_sim.getvalue() == my_str + def test_stdsim_write_bytes(stdout_sim): b_str = b'Hello World' with pytest.raises(TypeError): |