mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	Since FIXTURE_DIR_NAME is the name of the folder that contains the view and tests modules of the webhook and another folder called "fixtures" that store the fixtures, it is more appropriate to call it WEBHOOK_DIR_NAME, especially when we want to refer to the view module using this variable.
		
			
				
	
	
		
			36 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
from zerver.lib.test_classes import WebhookTestCase
 | 
						|
 | 
						|
 | 
						|
class AppveyorHookTests(WebhookTestCase):
 | 
						|
    STREAM_NAME = "appveyor"
 | 
						|
    URL_TEMPLATE = "/api/v1/external/appveyor?api_key={api_key}&stream={stream}"
 | 
						|
    WEBHOOK_DIR_NAME = "appveyor"
 | 
						|
 | 
						|
    def test_appveyor_build_success_message(self) -> None:
 | 
						|
        """
 | 
						|
        Tests if appveyor build success notification is handled correctly
 | 
						|
        """
 | 
						|
        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):
 | 
						|
* **Commit**: [c06e208b47: Increment version number.](https://github.com/joebloggs/Hubot-DSC-Resource/commit/c06e208b47) by Joe Bloggs
 | 
						|
* **Started**: 9/9/2018 7:04 PM
 | 
						|
* **Finished**: 9/9/2018 7:06 PM
 | 
						|
""".strip()
 | 
						|
 | 
						|
        self.check_webhook("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_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):
 | 
						|
* **Commit**: [c06e208b47: Increment version number.](https://github.com/joebloggs/Hubot-DSC-Resource/commit/c06e208b47) by Joe Bloggs
 | 
						|
* **Started**: 9/9/2018 7:04 PM
 | 
						|
* **Finished**: 9/9/2018 7:06 PM
 | 
						|
""".strip()
 | 
						|
 | 
						|
        self.check_webhook("appveyor_build_failure", expected_topic, expected_message)
 |