def test_create(self, mock_create): mock_create.return_value = NOTIFICATION result = self.controller.create(self.req, body={ "notification": { "hostname": "fake_host", "payload": { "instance_uuid": uuidsentinel.instance_uuid, "vir_domain_event": "STOPPED_FAILED", "event": "LIFECYCLE" }, "type": "VM", "generated_time": "2016-09-13T09:11:21.656788" } }) result = result['notification'] test_objects.compare_obj(self, result, NOTIFICATION_DATA, allow_missing=OPTIONAL)
def test_create(self, mock_create): mock_create.return_value = NOTIFICATION result = self.controller.create(self.req, body={ "notification": {"hostname": "fake_host", "payload": {"event": "STOPPED", "host_status": "NORMAL", "cluster_status": "ONLINE"}, "type": "VM", "generated_time": "2016-09-13T09:11:21.656788"}}) result = result['notification'] test_objects.compare_obj(self, result, NOTIFICATION_DATA)
def test_create_process_notification(self, mock_create): mock_create.return_value = NOTIFICATION result = self.controller.create(self.req, body={ "notification": { "hostname": "fake_host", "payload": { "process_name": "nova-compute", "event": "STOPPED" }, "type": "PROCESS", "generated_time": "2016-09-13T09:11:21.656788"}}) result = result['notification'] test_objects.compare_obj(self, result, NOTIFICATION_DATA, allow_missing=OPTIONAL)
def test_create(self, mock_create): mock_create.return_value = NOTIFICATION result = self.controller.create(self.req, body={ "notification": { "hostname": "fake_host", "payload": { "event": "STOPPED", "host_status": "NORMAL", "cluster_status": "ONLINE" }, "type": "VM", "generated_time": "2016-09-13T09:11:21.656788" } }) result = result['notification'] test_objects.compare_obj(self, result, NOTIFICATION_DATA)