def _stack_event_summary(self, stack): try: events = event_utils.get_events(self.clients.heat, stack_id=stack.stack_name, nested_depth=1, event_args={'sort_dir': 'asc'}) except exc.CommandError: return [] return util.heat_event_log_formatter(reversed(events))
def test_heat_event_log_formatter(self): events = [ mock.MagicMock( event_time="18:22", resource_name="Resource Name", resource_status="CREATE_IN_PROGRESS", resource_status_reason="create progress", ) ] widgets = util.heat_event_log_formatter(events) self.assertWidgetListEqual(widgets, [ urwid.Text( "18:22 [Resource Name]: CREATE_IN_PROGRESS create progress", wrap='clip') ])