Sweep tests for expected_subject -> expected_topic.

This is all in the webhooks tests, including some
docs for how to write those tests.
This commit is contained in:
Steve Howell
2018-11-09 19:33:58 +00:00
committed by Tim Abbott
parent 3133998af9
commit ced4d81856
54 changed files with 743 additions and 743 deletions

View File

@@ -10,7 +10,7 @@ class AppveyorHookTests(WebhookTestCase):
"""
Tests if appveyor build success notification is handled correctly
"""
expected_subject = "Hubot-DSC-Resource"
expected_topic = "Hubot-DSC-Resource"
expected_message = ("[Build Hubot-DSC-Resource 2.0.59 completed](https://ci.appveyor.com/project"
"/joebloggs/hubot-dsc-resource/build/2.0.59)\n"
"Commit [c06e208b47](https://github.com/joebloggs/Hubot-DSC-Resource"
@@ -19,13 +19,13 @@ class AppveyorHookTests(WebhookTestCase):
"Build Started: 9/9/2018 7:04 PM\n"
"Build Finished: 9/9/2018 7:06 PM")
self.send_and_test_stream_message('appveyor_build_success', expected_subject, expected_message)
self.send_and_test_stream_message('appveyor_build_success', expected_topic, expected_message)
def test_appveyor_build_failure_message(self) -> None:
"""
Tests if appveyor build failure notification is handled correctly
"""
expected_subject = "Hubot-DSC-Resource"
expected_topic = "Hubot-DSC-Resource"
expected_message = ("[Build Hubot-DSC-Resource 2.0.59 failed](https://ci.appveyor.com/project"
"/joebloggs/hubot-dsc-resource/build/2.0.59)\n"
"Commit [c06e208b47](https://github.com/joebloggs/Hubot-DSC-Resource"
@@ -34,7 +34,7 @@ class AppveyorHookTests(WebhookTestCase):
"Build Started: 9/9/2018 7:04 PM\n"
"Build Finished: 9/9/2018 7:06 PM")
self.send_and_test_stream_message('appveyor_build_failure', expected_subject, expected_message)
self.send_and_test_stream_message('appveyor_build_failure', expected_topic, expected_message)
def get_body(self, fixture_name: str) -> str:
return self.webhook_fixture_data("appveyor", fixture_name, file_type="json")