Skip to content

Commit bc6a7dd

Browse files
committed
Fix unit tests for notes
1 parent 584e671 commit bc6a7dd

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

tests/unit/test_notes.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff 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')

0 commit comments

Comments
 (0)