diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-01-17 17:50:24 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-01-17 17:50:24 -0500 |
commit | 2c7e9246e2748e9711e4b0e56c022b141f156c82 (patch) | |
tree | b322fc9ba09f7fcb6ff62321c0fc4335d7fa3edc /tests/test_utils.py | |
parent | 242efbdab9e9955bc20c15f0d28422f33b7936cc (diff) | |
download | cmd2-git-2c7e9246e2748e9711e4b0e56c022b141f156c82.tar.gz |
Renamed function
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r-- | tests/test_utils.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 08b282b7..c2fb9c2c 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -293,34 +293,34 @@ def test_context_flag_exit_err(context_flag): context_flag.__exit__() -def test_truncate_string(): - text = 'long' +def test_truncate_line(): + line = 'long' max_width = 3 - truncated = cu.truncate_string(text, max_width) + truncated = cu.truncate_line(line, max_width) assert truncated == 'lo\N{HORIZONTAL ELLIPSIS}' -def test_truncate_string_newline_in_text(): - text = 'fo\no' +def test_truncate_line_with_newline(): + line = 'fo\no' max_width = 2 with pytest.raises(ValueError): - cu.truncate_string(text, max_width) + cu.truncate_line(line, max_width) -def test_truncate_string_width_is_too_small(): - text = 'foo' +def test_truncate_line_width_is_too_small(): + line = 'foo' max_width = 0 with pytest.raises(ValueError): - cu.truncate_string(text, max_width) + cu.truncate_line(line, max_width) -def test_truncate_string_wide_text(): - text = '苹苹other' +def test_truncate_line_wide_text(): + line = '苹苹other' max_width = 6 - truncated = cu.truncate_string(text, max_width) + truncated = cu.truncate_line(line, max_width) assert truncated == '苹苹o\N{HORIZONTAL ELLIPSIS}' -def test_truncate_string_tabs(): - text = 'has\ttab' +def test_truncate_line_tabs(): + line = 'has\ttab' max_width = 9 - truncated = cu.truncate_string(text, max_width) + truncated = cu.truncate_line(line, max_width) assert truncated == 'has t\N{HORIZONTAL ELLIPSIS}' def test_align_text_fill_char_is_tab(): |