Skip to content

Commit fbef66b

Browse files
committed
test: added tests to print_help and debug case 2
1 parent 748d790 commit fbef66b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

commit_helper/utils/text_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def debug(message, value, show=False):
3333
print(DEBUG_COLOR + mid + RESET)
3434

3535

36-
# TEST:
3736
def print_help(message):
3837
print(HELP + str(message) + RESET)
3938

test/test_utils.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from commit_helper.utils.colors import RESET
66
from commit_helper.utils.colors import DEBUG_COLOR
77
from commit_helper.utils.colors import NOTIFY_COLOR
8+
from commit_helper.utils.colors import HELP
89

910

1011
def test_get_text():
@@ -66,6 +67,13 @@ def test_debug(capsys):
6667
raise AssertionError()
6768

6869

70+
def test_no_debug(capsys):
71+
text_utils.debug('msg', 666, show=False)
72+
captured = capsys.readouterr()
73+
if not captured.out is '':
74+
raise AssertionError()
75+
76+
6977
def test_dump_convention():
7078
not_good_conf = """
7179
convention:
@@ -129,3 +137,10 @@ def mock_input(s):
129137

130138
if not context == 'context':
131139
raise AssertionError()
140+
141+
142+
def test_print_help(capsys):
143+
text_utils.print_help('msg')
144+
captured = capsys.readouterr()
145+
if not captured.out == HELP + "msg" + RESET + "\n":
146+
raise AssertionError()

0 commit comments

Comments
 (0)