From 9c8056f03ff0e6fac515d9b8defff68a5eeef454 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sun, 29 Jan 2017 21:46:12 -0500 Subject: Added a 2nd way of unit testing transcript tests which covers some additional code. --- tests/test_transcript.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index d7e40295..253b338d 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -1,13 +1,14 @@ # coding=utf-8 -# -# Cmd2 functional testing based on transcript -# -# Copyright 2016 Federico Ceratto -# Released under MIT license, see LICENSE file +""" +Cmd2 functional testing based on transcript + +Copyright 2016 Federico Ceratto +Released under MIT license, see LICENSE file +""" import pytest -from cmd2 import Cmd, make_option, options +from cmd2 import Cmd, make_option, options, Cmd2TestCase from conftest import run_cmd, StdOut, _normalize @@ -134,3 +135,8 @@ now: ---> for cmd, expected in _get_transcript_blocks(transcript): out = run_cmd(app, cmd) assert out == expected + + +class TestMyAppCase(Cmd2TestCase): + CmdApp = CmdLineApp + CmdApp.testfiles = ['tests/transcript.txt'] -- cgit v1.2.1