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 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)
def testGetFormatted(self): b = raw_doc.RawBrief(self.brief_tok, raw_doc.RawText([self.brief_tok])) code_entry = raw_doc.RawVariable(self.brief_tok, [b]) code_entry.name = raw_doc.RawText([self.name_tok]) code_entry.type = raw_doc.RawText([self.type_tok]) code_entry.sees = [ raw_doc.RawSee(self.tok_see, raw_doc.RawText([self.tok_see])) ] s = raw_doc.RawSignature(self.tok_sig, raw_doc.RawText([self.tok_sig])) code_entry.addSignature(s) txt = ('@var int var;\n\n' '@brief This is brief.\n\n' '@signature payload\n\n' '@see See\n\n') self.assertMultiLineEqual(code_entry.getFormatted(self.formatter), txt)
def testGetFormatted(self): code_entry = raw_doc.RawCodeEntry(self.code_tok) b = raw_doc.RawBrief(self.brief_tok, raw_doc.RawText([self.brief_tok])) code_entry = raw_doc.RawCodeEntry(self.code_tok, [b]) code_entry.name = raw_doc.RawText([self.name_tok]) code_entry.title = raw_doc.RawText([self.title_tok]) code_entry.sees = [ raw_doc.RawSee(self.tok_see, raw_doc.RawText([self.tok_see])) ] s = raw_doc.RawSignature(self.tok_sig, raw_doc.RawText([self.tok_sig])) code_entry.addSignature(s) formatter = raw_doc.DoxFormatter() txt = ('@<code entry> Concept Concept Title\n\n' '@brief This is brief.\n\n' '@signature payload\n\n' '@see See\n\n') self.assertMultiLineEqual(code_entry.getFormatted(formatter), txt)
def testGetFormatted(self): brief = raw_doc.RawBrief(self.t, self.txt) self.assertEqual(brief.getFormatted(self.formatter), '@brief aword\n')
def testGetType(self): brief = raw_doc.RawBrief(self.t, self.txt) self.assertEqual(brief.getType(), 'brief')
def testCreation(self): brief = raw_doc.RawBrief(self.t, self.txt) self.assertEqual(brief.text, self.txt)