3
3
import pytest
4
4
5
5
from .cherry_picker import get_base_branch , get_current_branch , \
6
- get_full_sha_from_short , is_cpython_repo , CherryPicker , \
6
+ get_full_sha_from_short , get_author_info_from_short_sha , \
7
+ is_cpython_repo , CherryPicker , \
7
8
normalize_commit_message
8
9
9
10
@@ -44,6 +45,13 @@ def test_get_full_sha_from_short(subprocess_check_output):
44
45
assert get_full_sha_from_short ('22a594a' ) == '22a594a0047d7706537ff2ac676cdc0f1dcb329c'
45
46
46
47
48
+ @mock .patch ('subprocess.check_output' )
49
+ def test_get_author_info_from_short_sha (subprocess_check_output ):
50
+ mock_output = b"Armin Rigo <armin.rigo@gmail.com>"
51
+ subprocess_check_output .return_value = mock_output
52
+ assert get_author_info_from_short_sha ('22a594a' ) == 'Armin Rigo <armin.rigo@gmail.com>'
53
+
54
+
47
55
@mock .patch ('os.path.exists' )
48
56
def test_sorted_branch (os_path_exists ):
49
57
os_path_exists .return_value = True
@@ -119,18 +127,26 @@ def test_normalize_long_commit_message():
119
127
The `Show Source` was broken because of a change made in sphinx 1.5.1
120
128
In Sphinx 1.4.9, the sourcename was "index.txt".
121
129
In Sphinx 1.5.1+, it is now "index.rst.txt".
122
- (cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)"""
130
+ (cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)
131
+
132
+ Co-authored-by: Elmar Ritsch <35851+elritsch@users.noreply.github.com>"""
123
133
title , body = normalize_commit_message (commit_message )
124
134
assert title == "[3.6] Fix broken `Show Source` links on documentation pages (GH-3113)"
125
135
assert body == """The `Show Source` was broken because of a change made in sphinx 1.5.1
126
136
In Sphinx 1.4.9, the sourcename was "index.txt".
127
137
In Sphinx 1.5.1+, it is now "index.rst.txt".
128
- (cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)"""
138
+ (cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)
139
+
140
+ Co-authored-by: Elmar Ritsch <35851+elritsch@users.noreply.github.com>"""
129
141
130
142
def test_normalize_short_commit_message ():
131
143
commit_message = """[3.6] Fix broken `Show Source` links on documentation pages (GH-3113)
132
144
133
- (cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)"""
145
+ (cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)
146
+
147
+ Co-authored-by: Elmar Ritsch <35851+elritsch@users.noreply.github.com>"""
134
148
title , body = normalize_commit_message (commit_message )
135
149
assert title == "[3.6] Fix broken `Show Source` links on documentation pages (GH-3113)"
136
- assert body == """(cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)"""
150
+ assert body == """(cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)
151
+
152
+ Co-authored-by: Elmar Ritsch <35851+elritsch@users.noreply.github.com>"""
0 commit comments