Skip to content

Commit 71e8578

Browse files
committed
Unit test for show_contribution
1 parent 8f9c925 commit 71e8578

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/test_util.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,15 @@ def test_summarize_authors():
109109

110110
authors = [
111111
{'name' : 'Tim',
112-
'email' : '[email protected]'
112+
'email' : '[email protected]',
113+
'contribution' : '64.23%'
113114
}
114115
]
115-
116-
summary = util.Util().summarize(authors)
117-
assert summary == "<span class='git-authors'><a href='mailto:[email protected]'>Tim</a></span>"
116+
117+
config = { 'show_contribution' : False }
118+
summary = util.Util().summarize(authors, config)
119+
assert summary == "<span class='git-authors'><a href='mailto:[email protected]'>Tim</a></span>"
120+
121+
config = { 'show_contribution' : True }
122+
summary = util.Util().summarize(authors, config)
123+
assert summary == "<span class='git-authors'><a href='mailto:[email protected]'>Tim</a> (64.23%)</span>"

0 commit comments

Comments
 (0)