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 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 testGetFormatted(self): body = raw_doc.RawBody() body.addParagraph(self.p) self.assertEqual(body.getFormatted(self.formatter), 'aword\n')
def testCreation(self): body = raw_doc.RawBody() self.assertEqual(body.paragraphs, []) body.addParagraph(self.p) self.assertEqual(body.paragraphs, [self.p])