From be8bce7461439d8df8ea88f215dc35293881e107 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Wed, 5 Jul 2017 13:06:07 -0400 Subject: [PATCH] Added unit test --- tests/test_cmd2.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index e66c7b016..b75113dfc 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1231,3 +1231,12 @@ def test_exclude_from_history(abbrev_app): help""") assert out == expected + +def test_is_text_file_bad_input(base_app): + # Test with a non-existent file + file_is_valid = base_app.is_text_file('does_not_exist.txt') + assert not file_is_valid + + # Test with a directory + dir_is_valid = base_app.is_text_file('.') + assert not dir_is_valid