def testAddBrief(self): entry = raw_doc.RawEntry(self.tok) self.assertEqual(entry.briefs, []) b = raw_doc.RawBrief(self.brief_tok, raw_doc.RawText()) entry.addBrief(b) self.assertEqual(len(entry.briefs), 1) self.assertEqual(entry.briefs, [b])
def testInitialization(self): entry = raw_doc.RawEntry(self.tok) self.assertEqual(entry.name.text, raw_doc.RawText().text) self.assertEqual(len(entry.briefs), 0) self.assertEqual(entry.body, raw_doc.RawBody()) self.assertEqual(entry.sees, []) self.assertEqual(entry.command, '<entry>')
def testAddSee(self): entry = raw_doc.RawEntry(self.tok_see) self.assertEqual(entry.sees, []) s = raw_doc.RawSee(self.tok_see, raw_doc.RawText()) entry.addSee(s) self.assertEqual(len(entry.sees), 1) self.assertEqual(entry.sees, [s])
def testAddParagraph(self): entry = raw_doc.RawEntry(self.tok) self.assertEqual(entry.body, raw_doc.RawBody()) p = raw_doc.RawParagraph(self.tok) entry.addParagraph(p) b = raw_doc.RawBody() b.addParagraph(p) self.assertEqual(entry.body, b)
def testGetFormatted(self): b = raw_doc.RawBrief(self.brief_tok, raw_doc.RawText([self.brief_tok])) entry = raw_doc.RawEntry(self.brief_tok, [b]) entry.name = raw_doc.RawText([self.name_tok]) entry.title = raw_doc.RawText([self.title_tok]) entry.sees = [ raw_doc.RawSee(self.tok_see, raw_doc.RawText([self.tok_see])) ] formatter = raw_doc.DoxFormatter() msg = ('@<entry> Concept Concept Title\n\n' '@brief This is brief.\n\n' '@see See\n\n') self.assertMultiLineEqual(entry.getFormatted(formatter), msg)