Skip to content

Commit 581233b

Browse files
saygoxLee-W
authored andcommitted
test(commands/commit): change prepare-commit-msg hook for Mac
1 parent fadfb7a commit 581233b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

tests/commands/test_commit_command.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,10 @@ def test_WrapStdx(mocker):
574574
wrap_stout = commands.commit.WrapStdx(sys.stdout)
575575
wrap_stout.write("data")
576576

577-
writer_mock.assert_called_once_with("/dev/tty", 'w')
577+
if sys.platform == 'linux':
578+
writer_mock.assert_called_once_with("/dev/tty", 'w')
579+
else:
580+
pass
578581
writer_mock().write.assert_called_once_with("data")
579582

580583

@@ -587,5 +590,8 @@ def test_WrapStdx(mocker):
587590

588591
wrap_sterr.write("data")
589592

590-
writer_mock.assert_called_once_with("/dev/tty", 'w')
593+
if sys.platform == 'linux':
594+
writer_mock.assert_called_once_with("/dev/tty", 'w')
595+
else:
596+
pass
591597
writer_mock().write.assert_called_once_with("data")

tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
usage: cz commit [-h] [--retry] [--no-retry] [--dry-run]
22
[--write-message-to-file FILE_PATH] [-s] [-a] [-e]
33
[-l MESSAGE_LENGTH_LIMIT] [--]
4+
[--commit-msg-file COMMIT_MSG_FILE]
45

56
create new commit
67

@@ -20,3 +21,7 @@ options:
2021
-l, --message-length-limit MESSAGE_LENGTH_LIMIT
2122
length limit of the commit message; 0 for no limit
2223
-- Positional arguments separator (recommended)
24+
--commit-msg-file COMMIT_MSG_FILE
25+
ask for the name of the temporal file that contains
26+
the commit message. Using it in a git hook script:
27+
MSG_FILE=$1

0 commit comments

Comments
 (0)