def testAddSee(self): entry = raw_doc.RawEntry() self.assertEqual(entry.sees, []) s = raw_doc.RawSee(raw_doc.RawText()) entry.addSee(s) self.assertEqual(len(entry.sees), 1) self.assertEqual(entry.sees, [s])
def testGetFormatted(self): b = raw_doc.RawBrief(raw_doc.RawText([self.brief_tok])) entry = raw_doc.RawEntry([b]) entry.name = raw_doc.RawText([self.name_tok]) entry.title = raw_doc.RawText([self.title_tok]) entry.sees = [raw_doc.RawSee(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(raw_doc.RawText([self.brief_tok])) code_entry = raw_doc.RawVariable([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(raw_doc.RawText([self.tok_see]))] s = raw_doc.RawSignature(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() b = raw_doc.RawBrief(raw_doc.RawText([self.brief_tok])) code_entry = raw_doc.RawCodeEntry([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(raw_doc.RawText([self.tok_see]))] s = raw_doc.RawSignature(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 processSee(self, entry, node): for text in node.texts: t = lexer.Token('WORD', translateTypename(text), 0, 0, 0) raw_text = raw_doc.RawText(translateTokens([t])) entry.addSee(raw_doc.RawSee(raw_text))
def testGetFormatted(self): see = raw_doc.RawSee(self.txt) self.assertEqual(see.getFormatted(self.formatter), '@see aword\n')
def testGetType(self): see = raw_doc.RawSee(self.txt) self.assertEqual(see.getType(), 'see')
def testCreation(self): see = raw_doc.RawSee(self.txt) self.assertEqual(see.text, self.txt)