def test_exclude_empty(self):
        """
        Tests the format_fields function when include_empty is False.
        """
        actual = parserutils.format_fields(self.field_data,
                                           include_empty=False)
        expected = """\
Name: Jane
Age:  30"""
        self.assertEqual(actual, expected)
Beispiel #2
0
    def _summarize(self, include_empty=False):
        """

        """
        source_data = self.get_public_data_str()

        field_data = [
            ('Alert ID', self.id),
            ('Title', self.title),
            ('Level', self.level),
            ('Incidents', self.incidents),
            ('Created date', self.created_date),
            ('\nCollection', self.distillery),
            ('Document ID', self.doc_id),
            ('Source Data', '\n' + source_data),
            ('\nNotes', '\n' + str(self.notes)),
        ]

        return format_fields(field_data, include_empty=include_empty)