mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Generated by `pyupgrade --py3-plus --keep-percent-format` on all our Python code except `zthumbor` and `zulip-ec2-configure-interfaces`, followed by manual indentation fixes. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
from zerver.lib.test_classes import WebhookTestCase
 | 
						|
 | 
						|
 | 
						|
class CodeshipHookTests(WebhookTestCase):
 | 
						|
    STREAM_NAME = 'codeship'
 | 
						|
    URL_TEMPLATE = "/api/v1/external/codeship?stream={stream}&api_key={api_key}"
 | 
						|
    TOPIC = "codeship/docs"
 | 
						|
    FIXTURE_DIR_NAME = 'codeship'
 | 
						|
 | 
						|
    def test_codeship_build_in_testing_status_message(self) -> None:
 | 
						|
        """
 | 
						|
        Tests if codeship testing status is mapped correctly
 | 
						|
        """
 | 
						|
        expected_message = "[Build](https://www.codeship.com/projects/10213/builds/973711) triggered by beanieboi on master branch started."
 | 
						|
        self.send_and_test_stream_message('testing_build', self.TOPIC, expected_message)
 | 
						|
 | 
						|
    def test_codeship_build_in_error_status_message(self) -> None:
 | 
						|
        """
 | 
						|
        Tests if codeship error status is mapped correctly
 | 
						|
        """
 | 
						|
        expected_message = "[Build](https://www.codeship.com/projects/10213/builds/973711) triggered by beanieboi on master branch failed."
 | 
						|
        self.send_and_test_stream_message('error_build', self.TOPIC, expected_message)
 | 
						|
 | 
						|
    def test_codeship_build_in_success_status_message(self) -> None:
 | 
						|
        """
 | 
						|
        Tests if codeship success status is mapped correctly
 | 
						|
        """
 | 
						|
        expected_message = "[Build](https://www.codeship.com/projects/10213/builds/973711) triggered by beanieboi on master branch succeeded."
 | 
						|
        self.send_and_test_stream_message('success_build', self.TOPIC, expected_message)
 | 
						|
 | 
						|
    def test_codeship_build_in_other_status_status_message(self) -> None:
 | 
						|
        """
 | 
						|
        Tests if codeship other status is mapped correctly
 | 
						|
        """
 | 
						|
        expected_message = "[Build](https://www.codeship.com/projects/10213/builds/973711) triggered by beanieboi on master branch has some_other_status status."
 | 
						|
        self.send_and_test_stream_message('other_status_build', self.TOPIC, expected_message)
 |