diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-24 10:16:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-24 10:16:46 -0400 |
commit | e5e8a7954b9ace78cd49ef43c5f8d6203c227f0f (patch) | |
tree | d6589102bb8044ef9a03b4f6ac36ed63951b9329 /tests/test_pyscript.py | |
parent | dbe485957b421f6fd973b3a493de7b264b363d54 (diff) | |
parent | 0bf2824bcb9c00ee56dde660b432990fc0df22f4 (diff) | |
download | cmd2-git-e5e8a7954b9ace78cd49ef43c5f8d6203c227f0f.tar.gz |
Merge pull request #534 from python-cmd2/copy_stream
Fixed several hack classes built to simulate file descriptors
Diffstat (limited to 'tests/test_pyscript.py')
-rw-r--r-- | tests/test_pyscript.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_pyscript.py b/tests/test_pyscript.py index 73c1a62a..256e63a7 100644 --- a/tests/test_pyscript.py +++ b/tests/test_pyscript.py @@ -1,3 +1,4 @@ +# coding=utf-8 """ Unit/functional testing for argparse completer in cmd2 @@ -8,24 +9,25 @@ import os import pytest from cmd2.cmd2 import Cmd, with_argparser from cmd2 import argparse_completer -from .conftest import run_cmd, StdOut -from cmd2.utils import namedtuple_with_defaults +from .conftest import run_cmd +from cmd2.utils import namedtuple_with_defaults, StdSim + class PyscriptExample(Cmd): ratings_types = ['G', 'PG', 'PG-13', 'R', 'NC-17'] def _do_media_movies(self, args) -> None: if not args.command: - self.do_help('media movies') + self.do_help(['media movies']) else: print('media movies ' + str(args.__dict__)) def _do_media_shows(self, args) -> None: if not args.command: - self.do_help('media shows') + self.do_help(['media shows']) if not args.command: - self.do_help('media shows') + self.do_help(['media shows']) else: print('media shows ' + str(args.__dict__)) @@ -70,7 +72,7 @@ class PyscriptExample(Cmd): func(self, args) else: # No subcommand was provided, so call help - self.do_help('media') + self.do_help(['media']) foo_parser = argparse_completer.ACArgumentParser(prog='foo') foo_parser.add_argument('-c', dest='counter', action='count') @@ -114,8 +116,7 @@ class PyscriptExample(Cmd): @pytest.fixture def ps_app(): c = PyscriptExample() - c.stdout = StdOut() - + c.stdout = StdSim(c.stdout) return c @@ -131,8 +132,7 @@ class PyscriptCustomNameExample(Cmd): @pytest.fixture def ps_echo(): c = PyscriptCustomNameExample() - c.stdout = StdOut() - + c.stdout = StdSim(c.stdout) return c |