Skip to content

Commit be8bce7

Browse files
committed
Added unit test
1 parent 77dcf8c commit be8bce7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_cmd2.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,3 +1231,12 @@ def test_exclude_from_history(abbrev_app):
12311231
help""")
12321232
assert out == expected
12331233

1234+
1235+
def test_is_text_file_bad_input(base_app):
1236+
# Test with a non-existent file
1237+
file_is_valid = base_app.is_text_file('does_not_exist.txt')
1238+
assert not file_is_valid
1239+
1240+
# Test with a directory
1241+
dir_is_valid = base_app.is_text_file('.')
1242+
assert not dir_is_valid

0 commit comments

Comments
 (0)