summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-08-02 20:54:37 -0700
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-08-02 20:54:41 -0700
commitca27fac72bf8e0b5885587b354b8fcb889f8ee79 (patch)
tree3437bd70131981ca74139760ef4b29a5517aea11 /tests/test_utils.py
parent9a5fb90f18e90dbecf3a33337bbda36403b2256d (diff)
downloadcmd2-git-ca27fac72bf8e0b5885587b354b8fcb889f8ee79.tar.gz
Addeded utility function for combining unicode normalization and casefolding into a single step
Also: - Updated the alphabetical sort utility function to use this - Started adding explicit unit tests for functions in utils.py
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
new file mode 100644
index 00000000..55ff018b
--- /dev/null
+++ b/tests/test_utils.py
@@ -0,0 +1,16 @@
+# coding=utf-8
+"""
+Unit/functional testing for cmd2/utils.py module.
+
+Copyright 2018 Todd Leonhardt <todd.leonhardt@gmail.com>
+Released under MIT license, see LICENSE file
+"""
+from colorama import Fore
+import cmd2.utils as cu
+
+
+def test_strip_ansi():
+ base_str = 'Hello, world!'
+ ansi_str = Fore.GREEN + base_str + Fore.RESET
+ assert base_str != ansi_str
+ assert base_str == cu.strip_ansi(ansi_str)