2018-05-10 19:34:01 +02:00
from typing import Dict , Optional
2016-09-20 22:51:11 +02:00
2017-11-16 00:43:10 +01:00
import ujson
2016-11-10 19:30:09 +01:00
from zerver . lib . test_classes import WebhookTestCase
2018-08-01 10:53:40 +02:00
from zerver . lib . users import get_api_key
2017-11-16 00:43:10 +01:00
from zerver . lib . webhooks . git import COMMITS_LIMIT
from zerver . models import Message
2016-09-20 22:51:11 +02:00
class GithubV1HookTests ( WebhookTestCase ) :
2018-05-10 19:34:01 +02:00
STREAM_NAME = None # type: Optional[str]
2016-09-20 22:51:11 +02:00
URL_TEMPLATE = u " /api/v1/external/github "
2018-04-18 21:20:25 +02:00
FIXTURE_DIR_NAME = ' github_legacy '
2016-09-20 22:51:11 +02:00
SEND_STREAM = False
2018-05-10 19:34:01 +02:00
BRANCHES = None # type: Optional[str]
2016-09-20 22:51:11 +02:00
2017-04-26 02:57:47 +02:00
push_content = u """ zbenjamin [pushed](https://github.com/zbenjamin/zulip-test/compare/4f9adc4777d5...b95449196980) 3 commits to branch master.
2016-09-20 22:51:11 +02:00
2017-03-15 10:15:03 +01:00
* Add baz ( [ 48 c329a ] ( https : / / github . com / zbenjamin / zulip - test / commit / 48 c329a0b68a9a379ff195ee3f1c1f4ab0b2a89e ) )
* Baz needs to be longer ( [ 06 ebe5f ] ( https : / / github . com / zbenjamin / zulip - test / commit / 06 ebe5f472a32f6f31fd2a665f0c7442b69cce72 ) )
* Final edit to baz , I swear ( [ b954491 ] ( https : / / github . com / zbenjamin / zulip - test / commit / b95449196980507f08209bdfdc4f1d611689b7a8 ) ) """
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_spam_branch_is_ignored ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . SEND_STREAM = True
self . STREAM_NAME = ' commits '
self . BRANCHES = ' dev,staging '
data = self . get_body ( ' push ' )
# We subscribe to the stream in this test, even though
# it won't get written, to avoid failing for the wrong
# reason.
2017-08-25 06:37:47 +02:00
self . subscribe ( self . test_user , self . STREAM_NAME )
2016-09-20 22:51:11 +02:00
prior_count = Message . objects . count ( )
result = self . client_post ( self . URL_TEMPLATE , data )
self . assert_json_success ( result )
after_count = Message . objects . count ( )
self . assertEqual ( prior_count , after_count )
2018-05-10 19:34:01 +02:00
def get_body ( self , fixture_name : str ) - > Dict [ str , str ] :
2018-08-01 10:53:40 +02:00
api_key = get_api_key ( self . test_user )
2018-04-20 03:57:21 +02:00
data = ujson . loads ( self . webhook_fixture_data ( self . FIXTURE_DIR_NAME , ' v1_ ' + fixture_name ) )
2016-09-20 22:51:11 +02:00
data . update ( { ' email ' : self . TEST_USER_EMAIL ,
' api-key ' : api_key ,
' payload ' : ujson . dumps ( data [ ' payload ' ] ) } )
if self . SEND_STREAM :
data [ ' stream ' ] = self . STREAM_NAME
if self . BRANCHES is not None :
data [ ' branches ' ] = self . BRANCHES
return data
2018-05-10 19:34:01 +02:00
def basic_test ( self , fixture_name : str , stream_name : str ,
expected_subject : str , expected_content : str ,
send_stream : bool = False , branches : Optional [ str ] = None ) - > None :
2016-09-20 22:51:11 +02:00
self . STREAM_NAME = stream_name
self . SEND_STREAM = send_stream
self . BRANCHES = branches
self . send_and_test_stream_message ( fixture_name , expected_subject , expected_content , content_type = None )
2017-11-04 07:47:46 +01:00
def test_user_specified_branches ( self ) - > None :
2016-10-05 19:26:09 +02:00
self . basic_test ( ' push ' , ' my_commits ' , ' zulip-test / master ' , self . push_content ,
2016-09-20 22:51:11 +02:00
send_stream = True , branches = " master,staging " )
2017-11-04 07:47:46 +01:00
def test_user_specified_stream ( self ) - > None :
2016-09-20 22:51:11 +02:00
""" Around May 2013 the github webhook started to specify the stream.
Before then , the stream was hard coded to " commits " . """
2016-10-05 19:26:09 +02:00
self . basic_test ( ' push ' , ' my_commits ' , ' zulip-test / master ' , self . push_content ,
2016-09-20 22:51:11 +02:00
send_stream = True )
2017-11-04 07:47:46 +01:00
def test_legacy_hook ( self ) - > None :
2016-10-05 19:26:09 +02:00
self . basic_test ( ' push ' , ' commits ' , ' zulip-test / master ' , self . push_content )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_push_multiple_commits ( self ) - > None :
2017-03-15 10:15:03 +01:00
commit_info = " * Add baz ([48c329a](https://github.com/zbenjamin/zulip-test/commit/48c329a0b68a9a379ff195ee3f1c1f4ab0b2a89e)) \n "
2017-04-26 02:57:47 +02:00
expected_subject = " zbenjamin [pushed](https://github.com/zbenjamin/zulip-test/compare/4f9adc4777d5...b95449196980) 50 commits to branch master. \n \n {} [and {} more commit(s)] " . format (
2016-10-12 23:27:24 +02:00
commit_info * COMMITS_LIMIT ,
50 - COMMITS_LIMIT ,
2016-10-07 15:49:35 +02:00
)
self . basic_test ( ' push_commits_more_than_limit ' , ' commits ' , ' zulip-test / master ' , expected_subject )
2017-11-04 07:47:46 +01:00
def test_issues_opened ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' issues_opened ' , ' issues ' ,
2016-10-19 22:16:24 +02:00
" zulip-test / Issue #5 The frobnicator doesn ' t work " ,
2016-10-26 21:13:00 +02:00
" zbenjamin opened [Issue #5](https://github.com/zbenjamin/zulip-test/issues/5) \n \n ~~~ quote \n I tried changing the widgets, but I got: \r \n \r \n Permission denied: widgets are immutable \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_issue_comment ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' issue_comment ' , ' issues ' ,
2016-10-20 16:42:44 +02:00
" zulip-test / Issue #5 The frobnicator doesn ' t work " ,
2016-10-26 21:13:00 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/issues/5#issuecomment-23374280) on [Issue #5](https://github.com/zbenjamin/zulip-test/issues/5) \n \n ~~~ quote \n Whoops, I did something wrong. \r \n \r \n I ' m sorry. \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_issues_closed ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' issues_closed ' , ' issues ' ,
2016-10-19 22:16:24 +02:00
" zulip-test / Issue #5 The frobnicator doesn ' t work " ,
2016-10-26 21:13:00 +02:00
" zbenjamin closed [Issue #5](https://github.com/zbenjamin/zulip-test/issues/5) " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_opened ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_opened ' , ' commits ' ,
2016-10-11 18:58:04 +02:00
" zulip-test / PR #7 Counting is hard. " ,
2016-10-26 21:13:00 +02:00
" lfaraone opened [PR #7](https://github.com/zbenjamin/zulip-test/pull/7)(assigned to lfaraone) \n from `patch-2` to `master` \n \n ~~~ quote \n Omitted something I think? \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_closed ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_closed ' , ' commits ' ,
2016-10-11 18:58:04 +02:00
" zulip-test / PR #7 Counting is hard. " ,
2016-10-26 21:13:00 +02:00
" zbenjamin closed [PR #7](https://github.com/zbenjamin/zulip-test/pull/7) " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_synchronize ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_synchronize ' , ' commits ' ,
2016-10-11 18:58:04 +02:00
" zulip-test / PR #13 Even more cowbell. " ,
2016-10-26 21:13:00 +02:00
" zbenjamin synchronized [PR #13](https://github.com/zbenjamin/zulip-test/pull/13) " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_comment ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_comment ' , ' commits ' ,
2016-10-20 16:42:44 +02:00
" zulip-test / PR #9 Less cowbell. " ,
2016-10-26 21:13:00 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/pull/9#issuecomment-24771110) on [PR #9](https://github.com/zbenjamin/zulip-test/pull/9) \n \n ~~~ quote \n Yeah, who really needs more cowbell than we already have? \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_comment_user_specified_stream ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_comment ' , ' my_commits ' ,
2016-10-20 16:42:44 +02:00
" zulip-test / PR #9 Less cowbell. " ,
2016-10-26 21:13:00 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/pull/9#issuecomment-24771110) on [PR #9](https://github.com/zbenjamin/zulip-test/pull/9) \n \n ~~~ quote \n Yeah, who really needs more cowbell than we already have? \n ~~~ " ,
2016-09-20 22:51:11 +02:00
send_stream = True )
2017-11-04 07:47:46 +01:00
def test_commit_comment ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' commit_comment ' , ' commits ' ,
2016-10-26 21:29:23 +02:00
" zulip-test " ,
2016-10-27 21:43:15 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533#commitcomment-4252302) on [7c99467](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533) \n ~~~ quote \n Are we sure this is enough cowbell? \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_commit_comment_line ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' commit_comment_line ' , ' commits ' ,
2016-10-26 21:29:23 +02:00
" zulip-test " ,
2016-10-27 21:43:15 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533#commitcomment-4252307) on [7c99467](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533) \n ~~~ quote \n This line adds /unlucky/ cowbell (because of its line number). We should remove it. \n ~~~ " )
2016-09-20 22:51:11 +02:00
class GithubV2HookTests ( WebhookTestCase ) :
2018-05-10 19:34:01 +02:00
STREAM_NAME = None # type: Optional[str]
2016-09-20 22:51:11 +02:00
URL_TEMPLATE = u " /api/v1/external/github "
2018-04-18 21:20:25 +02:00
FIXTURE_DIR_NAME = ' github_legacy '
2016-09-20 22:51:11 +02:00
SEND_STREAM = False
2018-05-10 19:34:01 +02:00
BRANCHES = None # type: Optional[str]
2016-09-20 22:51:11 +02:00
2017-04-26 02:57:47 +02:00
push_content = """ zbenjamin [pushed](https://github.com/zbenjamin/zulip-test/compare/4f9adc4777d5...b95449196980) 3 commits to branch master.
2016-09-20 22:51:11 +02:00
2017-03-15 10:15:03 +01:00
* Add baz ( [ 48 c329a ] ( https : / / github . com / zbenjamin / zulip - test / commit / 48 c329a0b68a9a379ff195ee3f1c1f4ab0b2a89e ) )
* Baz needs to be longer ( [ 06 ebe5f ] ( https : / / github . com / zbenjamin / zulip - test / commit / 06 ebe5f472a32f6f31fd2a665f0c7442b69cce72 ) )
* Final edit to baz , I swear ( [ b954491 ] ( https : / / github . com / zbenjamin / zulip - test / commit / b95449196980507f08209bdfdc4f1d611689b7a8 ) ) """
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_spam_branch_is_ignored ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . SEND_STREAM = True
self . STREAM_NAME = ' commits '
self . BRANCHES = ' dev,staging '
data = self . get_body ( ' push ' )
# We subscribe to the stream in this test, even though
# it won't get written, to avoid failing for the wrong
# reason.
2017-08-25 06:37:47 +02:00
self . subscribe ( self . test_user , self . STREAM_NAME )
2016-09-20 22:51:11 +02:00
prior_count = Message . objects . count ( )
result = self . client_post ( self . URL_TEMPLATE , data )
self . assert_json_success ( result )
after_count = Message . objects . count ( )
self . assertEqual ( prior_count , after_count )
2018-05-10 19:34:01 +02:00
def get_body ( self , fixture_name : str ) - > Dict [ str , str ] :
2018-08-01 10:53:40 +02:00
api_key = get_api_key ( self . test_user )
2018-04-20 03:57:21 +02:00
data = ujson . loads ( self . webhook_fixture_data ( self . FIXTURE_DIR_NAME , ' v2_ ' + fixture_name ) )
2016-09-20 22:51:11 +02:00
data . update ( { ' email ' : self . TEST_USER_EMAIL ,
' api-key ' : api_key ,
' payload ' : ujson . dumps ( data [ ' payload ' ] ) } )
if self . SEND_STREAM :
data [ ' stream ' ] = self . STREAM_NAME
if self . BRANCHES is not None :
data [ ' branches ' ] = self . BRANCHES
return data
2018-05-10 19:34:01 +02:00
def basic_test ( self , fixture_name : str , stream_name : str ,
expected_subject : str , expected_content : str ,
send_stream : bool = False , branches : Optional [ str ] = None ) - > None :
2016-09-20 22:51:11 +02:00
self . STREAM_NAME = stream_name
self . SEND_STREAM = send_stream
self . BRANCHES = branches
self . send_and_test_stream_message ( fixture_name , expected_subject , expected_content , content_type = None )
2017-11-04 07:47:46 +01:00
def test_user_specified_branches ( self ) - > None :
2016-10-05 19:26:09 +02:00
self . basic_test ( ' push ' , ' my_commits ' , ' zulip-test / master ' , self . push_content ,
2016-09-20 22:51:11 +02:00
send_stream = True , branches = " master,staging " )
2017-11-04 07:47:46 +01:00
def test_user_specified_stream ( self ) - > None :
2016-09-20 22:51:11 +02:00
""" Around May 2013 the github webhook started to specify the stream.
Before then , the stream was hard coded to " commits " . """
2016-10-05 19:26:09 +02:00
self . basic_test ( ' push ' , ' my_commits ' , ' zulip-test / master ' , self . push_content ,
2016-09-20 22:51:11 +02:00
send_stream = True )
2017-11-04 07:47:46 +01:00
def test_push_multiple_commits ( self ) - > None :
2017-03-15 10:15:03 +01:00
commit_info = " * Add baz ([48c329a](https://github.com/zbenjamin/zulip-test/commit/48c329a0b68a9a379ff195ee3f1c1f4ab0b2a89e)) \n "
2017-04-26 02:57:47 +02:00
expected_subject = " zbenjamin [pushed](https://github.com/zbenjamin/zulip-test/compare/4f9adc4777d5...b95449196980) 50 commits to branch master. \n \n {} [and {} more commit(s)] " . format (
2016-10-12 23:27:24 +02:00
commit_info * COMMITS_LIMIT ,
50 - COMMITS_LIMIT ,
2016-10-07 15:49:35 +02:00
)
self . basic_test ( ' push_commits_more_than_limit ' , ' commits ' , ' zulip-test / master ' , expected_subject )
2017-11-04 07:47:46 +01:00
def test_push_multiple_committers ( self ) - > None :
2017-04-05 09:12:19 +02:00
commit_info = " * Add baz ([48c329a](https://github.com/zbenjamin/zulip-test/commit/48c329a0b68a9a379ff195ee3f1c1f4ab0b2a89e)) \n "
2017-04-26 00:19:47 +02:00
expected_subject = " zbenjamin [pushed](https://github.com/zbenjamin/zulip-test/compare/4f9adc4777d5...b95449196980) 6 commits to branch master. Commits by tomasz (3), baxthehacker (2) and zbenjamin (1). \n \n {} * Add baz ([48c329a](https://github.com/zbenjamin/zulip-test/commit/48c329a0b68a9a379ff195ee3f1c1f4ab0b2a89e)) " . format ( commit_info * 5 )
2017-04-05 09:12:19 +02:00
self . basic_test ( ' push_multiple_committers ' , ' commits ' , ' zulip-test / master ' , expected_subject )
2017-11-04 07:47:46 +01:00
def test_push_multiple_committers_with_others ( self ) - > None :
2017-04-05 09:12:19 +02:00
commit_info = " * Final edit to baz, I swear ([b954491](https://github.com/zbenjamin/zulip-test/commit/b95449196980507f08209bdfdc4f1d611689b7a8)) \n "
2017-04-26 00:19:47 +02:00
expected_subject = " zbenjamin [pushed](https://github.com/zbenjamin/zulip-test/compare/4f9adc4777d5...b95449196980) 10 commits to branch master. Commits by baxthehacker (4), James (3), Tomasz (2) and others (1). \n \n {} * Final edit to baz, I swear ([b954491](https://github.com/zbenjamin/zulip-test/commit/b95449196980507f08209bdfdc4f1d611689b7a8)) " . format ( commit_info * 9 )
2017-04-05 09:12:19 +02:00
self . basic_test ( ' push_multiple_committers_with_others ' , ' commits ' , ' zulip-test / master ' , expected_subject )
2017-11-04 07:47:46 +01:00
def test_legacy_hook ( self ) - > None :
2016-10-05 19:26:09 +02:00
self . basic_test ( ' push ' , ' commits ' , ' zulip-test / master ' , self . push_content )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_issues_opened ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' issues_opened ' , ' issues ' ,
2016-10-19 22:16:24 +02:00
" zulip-test / Issue #5 The frobnicator doesn ' t work " ,
2016-10-26 21:13:00 +02:00
" zbenjamin opened [Issue #5](https://github.com/zbenjamin/zulip-test/issues/5) \n \n ~~~ quote \n I tried changing the widgets, but I got: \r \n \r \n Permission denied: widgets are immutable \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_issue_comment ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' issue_comment ' , ' issues ' ,
2016-10-20 16:42:44 +02:00
" zulip-test / Issue #5 The frobnicator doesn ' t work " ,
2016-10-26 21:13:00 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/issues/5#issuecomment-23374280) on [Issue #5](https://github.com/zbenjamin/zulip-test/issues/5) \n \n ~~~ quote \n Whoops, I did something wrong. \r \n \r \n I ' m sorry. \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_issues_closed ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' issues_closed ' , ' issues ' ,
2016-10-19 22:16:24 +02:00
" zulip-test / Issue #5 The frobnicator doesn ' t work " ,
2016-10-26 21:13:00 +02:00
" zbenjamin closed [Issue #5](https://github.com/zbenjamin/zulip-test/issues/5) " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_opened ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_opened ' , ' commits ' ,
2016-10-11 18:58:04 +02:00
" zulip-test / PR #7 Counting is hard. " ,
2016-10-26 21:13:00 +02:00
" lfaraone opened [PR #7](https://github.com/zbenjamin/zulip-test/pull/7)(assigned to lfaraone) \n from `patch-2` to `master` \n \n ~~~ quote \n Omitted something I think? \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_closed ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_closed ' , ' commits ' ,
2016-10-11 18:58:04 +02:00
" zulip-test / PR #7 Counting is hard. " ,
2016-10-26 21:13:00 +02:00
" zbenjamin closed [PR #7](https://github.com/zbenjamin/zulip-test/pull/7) " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_synchronize ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_synchronize ' , ' commits ' ,
2016-10-11 18:58:04 +02:00
" zulip-test / PR #13 Even more cowbell. " ,
2016-10-26 21:13:00 +02:00
" zbenjamin synchronized [PR #13](https://github.com/zbenjamin/zulip-test/pull/13) " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_comment ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_comment ' , ' commits ' ,
2016-10-20 16:42:44 +02:00
" zulip-test / PR #9 Less cowbell. " ,
2016-10-26 21:13:00 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/pull/9#issuecomment-24771110) on [PR #9](https://github.com/zbenjamin/zulip-test/pull/9) \n \n ~~~ quote \n Yeah, who really needs more cowbell than we already have? \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_pull_request_comment_user_specified_stream ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' pull_request_comment ' , ' my_commits ' ,
2016-10-20 16:42:44 +02:00
" zulip-test / PR #9 Less cowbell. " ,
2016-10-26 21:13:00 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/pull/9#issuecomment-24771110) on [PR #9](https://github.com/zbenjamin/zulip-test/pull/9) \n \n ~~~ quote \n Yeah, who really needs more cowbell than we already have? \n ~~~ " ,
2016-09-20 22:51:11 +02:00
send_stream = True )
2017-11-04 07:47:46 +01:00
def test_commit_comment ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' commit_comment ' , ' commits ' ,
2016-10-26 21:29:23 +02:00
" zulip-test " ,
2016-10-27 21:43:15 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533#commitcomment-4252302) on [7c99467](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533) \n ~~~ quote \n Are we sure this is enough cowbell? \n ~~~ " )
2016-09-20 22:51:11 +02:00
2017-11-04 07:47:46 +01:00
def test_commit_comment_line ( self ) - > None :
2016-09-20 22:51:11 +02:00
self . basic_test ( ' commit_comment_line ' , ' commits ' ,
2016-10-26 21:29:23 +02:00
" zulip-test " ,
2016-10-27 21:43:15 +02:00
" zbenjamin [commented](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533#commitcomment-4252307) on [7c99467](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533) \n ~~~ quote \n This line adds /unlucky/ cowbell (because of its line number). We should remove it. \n ~~~ " )