From 4a3d01b679c5db7f6cb670ca981a953eb3b98dc5 Mon Sep 17 00:00:00 2001 From: kotfu Date: Mon, 16 Apr 2018 23:03:49 -0600 Subject: Basic structure for cmd2 as a package Still have a fair amount of work to do to get this sorted. --- tests/test_transcript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index a24f2fa5..f3d98b0a 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -16,7 +16,7 @@ import pytest import cmd2 from cmd2 import Cmd, Cmd2TestCase, set_posix_shlex, set_strip_quotes -from conftest import run_cmd, StdOut, normalize +#from conftest import run_cmd, StdOut, normalize class CmdLineApp(Cmd): -- cgit v1.2.1 From 49f02121cbe01de1c8203a15e22ab928b37b8971 Mon Sep 17 00:00:00 2001 From: kotfu Date: Mon, 16 Apr 2018 23:09:26 -0600 Subject: Revert "Basic structure for cmd2 as a package" This reverts commit 4a3d01b679c5db7f6cb670ca981a953eb3b98dc5. --- tests/test_transcript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index f3d98b0a..a24f2fa5 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -16,7 +16,7 @@ import pytest import cmd2 from cmd2 import Cmd, Cmd2TestCase, set_posix_shlex, set_strip_quotes -#from conftest import run_cmd, StdOut, normalize +from conftest import run_cmd, StdOut, normalize class CmdLineApp(Cmd): -- cgit v1.2.1 From 46ebe95304de710145ded8caf421c6b6950dba6d Mon Sep 17 00:00:00 2001 From: kotfu Date: Mon, 16 Apr 2018 23:21:59 -0600 Subject: Basic structure for cmd2 as a package --- tests/test_transcript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index a24f2fa5..f3d98b0a 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -16,7 +16,7 @@ import pytest import cmd2 from cmd2 import Cmd, Cmd2TestCase, set_posix_shlex, set_strip_quotes -from conftest import run_cmd, StdOut, normalize +#from conftest import run_cmd, StdOut, normalize class CmdLineApp(Cmd): -- cgit v1.2.1 From ff4ebc85bb5185efec9a072e38129c3982ad83af Mon Sep 17 00:00:00 2001 From: kotfu Date: Mon, 16 Apr 2018 23:34:23 -0600 Subject: Most of the unit tests fixed. --- tests/test_transcript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index f3d98b0a..e25d8532 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -16,7 +16,7 @@ import pytest import cmd2 from cmd2 import Cmd, Cmd2TestCase, set_posix_shlex, set_strip_quotes -#from conftest import run_cmd, StdOut, normalize +from .conftest import run_cmd, StdOut, normalize class CmdLineApp(Cmd): -- cgit v1.2.1 From 9697bf1858c6ef06e13bdfd3dfaea6d0376d9a6a Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Tue, 17 Apr 2018 19:30:18 -0700 Subject: Cleaned up __init__.py Removed things which were only needed for unit tests from __init__.py - Converted to importing from cmd2.cmd2. within the relevant unit tests --- tests/test_transcript.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index e25d8532..8ee5f3f6 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -15,10 +15,10 @@ from unittest import mock import pytest import cmd2 -from cmd2 import Cmd, Cmd2TestCase, set_posix_shlex, set_strip_quotes +from cmd2 import set_posix_shlex, set_strip_quotes from .conftest import run_cmd, StdOut, normalize -class CmdLineApp(Cmd): +class CmdLineApp(cmd2.Cmd): MUMBLES = ['like', '...', 'um', 'er', 'hmmm', 'ahh'] MUMBLE_FIRST = ['so', 'like', 'well'] @@ -82,7 +82,7 @@ class CmdLineApp(Cmd): self.poutput(' '.join(output)) -class DemoApp(Cmd): +class DemoApp(cmd2.Cmd): hello_parser = argparse.ArgumentParser() hello_parser.add_argument('-n', '--name', help="your name") @cmd2.with_argparser_and_unknown_args(hello_parser) @@ -189,7 +189,7 @@ now: ---> assert out == expected -class TestMyAppCase(Cmd2TestCase): +class TestMyAppCase(cmd2.cmd2.Cmd2TestCase): CmdApp = CmdLineApp CmdApp.testfiles = ['tests/transcript.txt'] @@ -293,7 +293,7 @@ def test_transcript(request, capsys, filename, feedback_to_output): def test_parse_transcript_expected(expected, transformed): app = CmdLineApp() - class TestMyAppCase(Cmd2TestCase): + class TestMyAppCase(cmd2.cmd2.Cmd2TestCase): cmdapp = app testcase = TestMyAppCase() -- cgit v1.2.1