summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py13
-rw-r--r--tests/script.py6
-rw-r--r--tests/test_cmd2.py6
-rw-r--r--tests/test_transcript.py1
4 files changed, 16 insertions, 10 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 8bc11497..6f3131e7 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,9 +1,10 @@
# coding=utf-8
-#
-# Cmd2 unit/functional testing
-#
-# Copyright 2016 Federico Ceratto <federico.ceratto@gmail.com>
-# Released under MIT license, see LICENSE file
+"""
+Cmd2 unit/functional testing
+
+Copyright 2016 Federico Ceratto <federico.ceratto@gmail.com>
+Released under MIT license, see LICENSE file
+"""
import sys
from pytest import fixture
@@ -83,7 +84,7 @@ timing: False # Report execution times
class StdOut(object):
- """ Toy class for replacing self.stdout in cmd2.Cmd instances fror unit testing. """
+ """ Toy class for replacing self.stdout in cmd2.Cmd instances for unit testing. """
def __init__(self):
self.buffer = ''
diff --git a/tests/script.py b/tests/script.py
index 30d45960..5195b8cc 100644
--- a/tests/script.py
+++ b/tests/script.py
@@ -1,2 +1,6 @@
#!/usr/bin/env python
-print("This is a python script running ...") \ No newline at end of file
+# coding=utf-8
+"""
+Trivial example of a Python script which can be run inside a cmd2 application.
+"""
+print("This is a python script running ...")
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 0f1328f3..99409d46 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -75,7 +75,7 @@ def test_base_set_not_supported(base_app, capsys):
run_cmd(base_app, 'set qqq True')
out, err = capsys.readouterr()
expected = normalize("""
-EXCEPTION of type 'LookupError' occured with message: 'Parameter 'qqq' not supported (type 'show' for list of parameters).'
+EXCEPTION of type 'LookupError' occurred with message: 'Parameter 'qqq' not supported (type 'show' for list of parameters).'
To enable full traceback, run the following command: 'set debug true'
""")
assert normalize(str(err)) == expected
@@ -446,12 +446,12 @@ def test_base_colorize(base_app):
def _expected_no_editor_error():
expected_exception = 'OSError'
- # If using Python 2 or PyPy (either 2 or 3), expect a differen excpetion than with Python 3
+ # If using Python 2 or PyPy (either 2 or 3), expect a different exception than with Python 3
if six.PY2 or hasattr(sys, "pypy_translation_info"):
expected_exception = 'EnvironmentError'
expected_text = normalize("""
-EXCEPTION of type '{}' occured with message: 'Please use 'set editor' to specify your text editing program of choice.'
+EXCEPTION of type '{}' occurred with message: 'Please use 'set editor' to specify your text editing program of choice.'
To enable full traceback, run the following command: 'set debug true'
""".format(expected_exception))
diff --git a/tests/test_transcript.py b/tests/test_transcript.py
index 6b229862..c0966d03 100644
--- a/tests/test_transcript.py
+++ b/tests/test_transcript.py
@@ -32,6 +32,7 @@ class CmdLineApp(Cmd):
opts = [make_option('-p', '--piglatin', action="store_true", help="atinLay"),
make_option('-s', '--shout', action="store_true", help="N00B EMULATION MODE"),
make_option('-r', '--repeat', type="int", help="output [n] times")]
+
@options(opts, arg_desc='(text to say)')
def do_speak(self, arg, opts=None):
"""Repeats what you tell me to."""