File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,12 +12,34 @@ def setUp(self):
1212
1313 self .note = """
1414 {
15- "status": "ok"
15+ "id": "62b62c6c-fca3-4329-b517-fc47c2371e63",
16+ "note": {
17+ "attributes": {
18+ "environment": "Production",
19+ "event": "node_down",
20+ "resource": "web01",
21+ "severity": "major",
22+ "status": "open"
23+ },
24+ "createTime": "2020-04-19T10:45:49.385Z",
25+ "customer": null,
26+ "href": "http://localhost:8080/note/62b62c6c-fca3-4329-b517-fc47c2371e63",
27+ "id": "62b62c6c-fca3-4329-b517-fc47c2371e63",
28+ "related": {
29+ "alert": "e7020428-5dad-4a41-9bfe-78e9d55cda06"
30+ },
31+ "text": "this is a new note",
32+ "type": "alert",
33+ "updateTime": null,
34+ "user": null
35+ },
36+ "status": "ok"
1637 }
1738 """
1839
1940 @requests_mock .mock ()
2041 def test_add_note (self , m ):
2142 m .put ('http://localhost:8080/alert/e7020428-5dad-4a41-9bfe-78e9d55cda06/note' , text = self .note )
22- r = self .client .alert_note (id = 'e7020428-5dad-4a41-9bfe-78e9d55cda06' , text = 'this is a test note' )
43+ r = self .client .alert_note (id = 'e7020428-5dad-4a41-9bfe-78e9d55cda06' , text = 'this is a new note' )
2344 self .assertEqual (r ['status' ], 'ok' )
45+ self .assertEqual (r ['note' ]['text' ], 'this is a new note' )
You can’t perform that action at this time.
0 commit comments