webhooks/github: Improve logic for page build messages.

Some of the page build message code had insufficient test coverage.
I looked at generating the payloads that would allow me to test
the lines of code in question, but it was too much work to
generate the payloads and this seemed like a vague event anyway.

So I just rewrote the logic so that the lines missing
coverage are implicitly covered.
This commit is contained in:
Eeshan Garg
2018-09-27 17:25:45 -02:30
committed by Rishi Gupta
parent 4f34ee2e6b
commit 42e3410df1
2 changed files with 14 additions and 12 deletions

View File

@@ -211,7 +211,7 @@ class GithubWebhookTest(WebhookTestCase):
self.send_and_test_stream_message('release', self.EXPECTED_SUBJECT_REPO_EVENTS, expected_message, HTTP_X_GITHUB_EVENT='release')
def test_page_build_msg(self) -> None:
expected_message = u"Github Pages build, trigerred by baxterthehacker, is built"
expected_message = u"Github Pages build, trigerred by baxterthehacker, has finished building"
self.send_and_test_stream_message('page_build', self.EXPECTED_SUBJECT_REPO_EVENTS, expected_message, HTTP_X_GITHUB_EVENT='page_build')
def test_status_msg(self) -> None: