mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	newrelic: Added owner field and cleaned up code.
I reformatted the tests and view to include information about who acknowledged and closed the alert. Only includes the information about the owner if there was an owner. Made a few small changes to the refactored bit as requested in review.
This commit is contained in:
		@@ -9,7 +9,7 @@ class NewRelicHookTests(WebhookTestCase):
 | 
			
		||||
    def test_open(self) -> None:
 | 
			
		||||
        expected_topic = "Test policy name (1234)"
 | 
			
		||||
        expected_message = """
 | 
			
		||||
[Incident](https://alerts.newrelic.com/accounts/2941966/incidents/1234) **opened** for condition: **Server Down** at <time:2020-11-11 22:32:11.151000>
 | 
			
		||||
[Incident](https://alerts.newrelic.com/accounts/2941966/incidents/1234) **opened** for condition: **Server Down** at <time:2020-11-11 22:32:11.151000+00:00>
 | 
			
		||||
``` quote
 | 
			
		||||
Violation description test.
 | 
			
		||||
```
 | 
			
		||||
@@ -38,7 +38,7 @@ Violation description test.
 | 
			
		||||
    def test_acknowledged(self) -> None:
 | 
			
		||||
        expected_topic = "Test policy name (1234)"
 | 
			
		||||
        expected_message = """
 | 
			
		||||
[Incident](https://alerts.newrelic.com/accounts/2941966/incidents/1234) **acknowledged** for condition: **Server Down**
 | 
			
		||||
[Incident](https://alerts.newrelic.com/accounts/2941966/incidents/1234) **acknowledged** by **Alice** for condition: **Server Down**
 | 
			
		||||
""".strip()
 | 
			
		||||
 | 
			
		||||
        self.check_webhook(
 | 
			
		||||
@@ -61,7 +61,7 @@ Violation description test.
 | 
			
		||||
    def test_missing_fields(self) -> None:
 | 
			
		||||
        expected_topic = "Unknown Policy (Unknown ID)"
 | 
			
		||||
        expected_message = """
 | 
			
		||||
[Incident](https://alerts.newrelic.com) **opened** for condition: **Unknown condition** at <time:2020-11-11 22:32:11.151000>
 | 
			
		||||
[Incident](https://alerts.newrelic.com) **opened** for condition: **Unknown condition** at <time:2020-11-11 22:32:11.151000+00:00>
 | 
			
		||||
``` quote
 | 
			
		||||
No details.
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user