File tree Expand file tree Collapse file tree 6 files changed +19
-13
lines changed Expand file tree Collapse file tree 6 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -8,5 +8,10 @@ install:
88script :
99 - pytest test/ -v
1010 - pycodestyle *.py
11+ after_script :
12+ - py.test --cov-report term --cov=.
13+ - codeclimate-test-reporter
14+ - coverage xml
15+ - python-codacy-coverage -r coverage.xml
1116notification :
1217 email : false
Original file line number Diff line number Diff line change 11def symphony_convention (tag , msg ):
22 tag = tag .capitalize ()
33 composed = "[%s] %s\n " % (tag , msg )
4+ return composed
Original file line number Diff line number Diff line change @@ -35,19 +35,18 @@ def main(debug_mode=False):
3535 convention = 'none'
3636
3737 if convention == 'none' :
38+ print ('You are not using a convention' )
3839 commit_message = just_message ()
3940
4041 else :
42+ print ('You are using the %s convention' % convention )
4143 tag , msg = get_text ()
4244 if convention == 'angular' or convention == 'karma' :
43- print ('You are using the %s convention' % convention )
4445 context = get_context ()
4546 commit_message = angular_convention (tag , msg , context )
4647 elif convention == 'changelog' :
47- print ('You are using the %s convention' % convention )
4848 commit_message = changelog_convention (tag , msg )
4949 elif convention == 'symphony' :
50- print ('You are using the %s convention' % convention )
5150 commit_message = symphony_convention (tag , msg )
5251
5352 commit_message += gen_co_author (args .co_author )
@@ -88,7 +87,8 @@ def main(debug_mode=False):
8887 parser .print_help ()
8988
9089
91- parser = parser_cli ()
92- args = parser .parse_args ()
93- debug ('args variable' , args , args .debug )
94- main (args .debug )
90+ if __name__ == '__main__' :
91+ parser = parser_cli ()
92+ args = parser .parse_args ()
93+ debug ('args variable' , args , args .debug )
94+ main (args .debug )
Original file line number Diff line number Diff line change @@ -2,3 +2,7 @@ pyyaml==3.13
22pytest == 3.8.1
33pycodestyle == 2.4.0
44argparse == 1.4.0
5+ coverage == 4.3
6+ pytest-cov == 2.0.0
7+ codeclimate-test-reporter
8+ codacy-coverage == 1.3
Original file line number Diff line number Diff line change 77
88def test_angular_convention_with_context ():
99 message = angular .angular_convention ('TAG' , 'message' , 'context' )
10-
1110 if not ('tag(context): message\n ' ):
1211 raise AssertionError ()
1312
1413
1514def test_angular_convention_without_context ():
1615 message = angular .angular_convention ('tag' , 'message' , '' )
17-
1816 if not ('tag: message\n ' ):
1917 raise AssertionError ()
2018
2119
2220def test_changelog_convention ():
2321 message = changelog .changelog_convention ('tag' , 'message' )
24-
2522 if not ('TAG: message\n ' ):
2623 raise AssertionError ()
2724
2825
2926def test_symphony_convention ():
3027 message = symphony .symphony_convention ('tag' , 'message' )
31-
3228 if not ('[Tag] message\n ' ):
3329 raise AssertionError ()
3430
3531
3632def test_no_convention ():
3733 inputs = [
38- "message" ,
34+ "message" ,
3935 ]
4036
4137 def mock_input (s ):
4238 return inputs .pop (0 )
4339 no_convention .input = mock_input
44-
4540 message = no_convention .just_message ()
4641 if not message == 'Message\n ' :
4742 raise AssertionError ()
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ def test_get_text():
1010
1111 def mock_input (s ):
1212 return inputs .pop (0 )
13+
1314 utils .input = mock_input
1415 a , b = utils .get_text ()
1516 if not a == 'tag' :
You can’t perform that action at this time.
0 commit comments