diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-01-17 17:44:50 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-01-17 17:44:50 -0500 |
commit | 242efbdab9e9955bc20c15f0d28422f33b7936cc (patch) | |
tree | 2696093a0271fa46dfc14783833a4aa3915a7a84 /cmd2/utils.py | |
parent | d7eee7d72d7673bbffad848170d8021465bf909f (diff) | |
download | cmd2-git-242efbdab9e9955bc20c15f0d28422f33b7936cc.tar.gz |
Updating unit tests
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r-- | cmd2/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py index cb8922f6..32781e28 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -667,7 +667,7 @@ def align_text(text: str, alignment: TextAlignment, *, fill_char: str = ' ', if width is None: width = shutil.get_terminal_size().columns - if width <= 1: + if width < 1: raise ValueError("width must be at least 1") # Handle tabs @@ -822,7 +822,7 @@ def truncate_string(text: str, max_width: int, *, tab_width: int = 4) -> str: if ansi.style_aware_wcswidth(text) == -1: raise (ValueError("text contains an unprintable character")) - if max_width <= 1: + if max_width < 1: raise ValueError("max_width must be at least 1") if ansi.style_aware_wcswidth(text) > max_width: |