diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-05 13:06:07 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-05 13:06:07 -0400 |
commit | be8bce7461439d8df8ea88f215dc35293881e107 (patch) | |
tree | 024ca187f578498edd37674050706c8bbea46f01 | |
parent | 77dcf8c70e7182d23c44a6f5fcbbd75bf4efdd67 (diff) | |
download | cmd2-git-be8bce7461439d8df8ea88f215dc35293881e107.tar.gz |
Added unit test
-rw-r--r-- | tests/test_cmd2.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index e66c7b01..b75113df 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 |