Exemple #1
0
 def test_append_text_2(self):
     txt = "TEXT  TAIL"
     span = Span(text=txt)
     self.assertEqual(span.text, "TEXT ")
     self.assertEqual(span[0].TAG, CN('text:s'))
     self.assertEqual(span[0].tail, "TAIL")
     self.assertEqual(span.plaintext(), txt)
Exemple #2
0
 def test_append_text_2(self):
     txt = "TEXT  TAIL"
     span = Span(text=txt)
     self.assertEqual(span.text, "TEXT ")
     self.assertEqual(span[0].TAG, CN('text:s'))
     self.assertEqual(span[0].tail, "TAIL")
     self.assertEqual(span.plaintext(), txt)
Exemple #3
0
 def test_append_text_3(self):
     txt = "TEXT  TAIL \n  \t    "
     span = Span(text=txt)
     self.assertEqual(span.text, "TEXT ")
     self.assertEqual(span[0].TAG, CN('text:s'))
     self.assertEqual(span[0].tail, "TAIL ")
     self.assertEqual(span[1].TAG, CN('text:line-break'))
     self.assertEqual(span[1].tail, " ")
     self.assertEqual(span[2].TAG, CN('text:s'))
     self.assertEqual(span[2].tail, None)
     self.assertEqual(span[3].TAG, CN('text:tab'))
     self.assertEqual(span[3].tail, " ")
     self.assertEqual(span[4].TAG, CN('text:s'))
     self.assertEqual(span[4].count, 3)
     self.assertEqual(span.plaintext(), txt)
Exemple #4
0
 def test_append_text_3(self):
     txt = "TEXT  TAIL \n  \t    "
     span = Span(text=txt)
     self.assertEqual(span.text, "TEXT ")
     self.assertEqual(span[0].TAG, CN('text:s'))
     self.assertEqual(span[0].tail, "TAIL ")
     self.assertEqual(span[1].TAG, CN('text:line-break'))
     self.assertEqual(span[1].tail, " ")
     self.assertEqual(span[2].TAG, CN('text:s'))
     self.assertEqual(span[2].tail, None)
     self.assertEqual(span[3].TAG, CN('text:tab'))
     self.assertEqual(span[3].tail, " ")
     self.assertEqual(span[4].TAG, CN('text:s'))
     self.assertEqual(span[4].count, 3)
     self.assertEqual(span.plaintext(), txt)
Exemple #5
0
 def test_plaintext_with_all(self):
     span = Span(xmlnode=etree.XML(SPANDATA_ALL))
     self.assertEqual(span.plaintext(), 'Line1\nLine2\t123    tail')
Exemple #6
0
 def test_plaintext_with_tab(self):
     span = Span(xmlnode=etree.XML(SPANDATA_TAB))
     self.assertEqual(span.plaintext(), 'Line1\tLine2')
Exemple #7
0
 def test_plaintext_with_line_break(self):
     span = Span(xmlnode=etree.XML(SPANDATA_BRK))
     self.assertEqual(span.plaintext(), 'Line1\nLine2')
Exemple #8
0
 def test_plaintext_with_spaces(self):
     span = Span(xmlnode=etree.XML(SPANDATA_SPC))
     self.assertEqual(span.plaintext(), 'aliquyam    ')
Exemple #9
0
 def test_append_text(self):
     txt = "TEXT"
     span = Span(text=txt)
     self.assertEqual(span.text, txt)
     self.assertEqual(span.plaintext(), txt)
Exemple #10
0
 def test_plaintext_with_all(self):
     span = Span(xmlnode=etree.XML(SPANDATA_ALL))
     self.assertEqual(span.plaintext(), 'Line1\nLine2\t123    tail')
Exemple #11
0
 def test_plaintext_with_tab(self):
     span = Span(xmlnode=etree.XML(SPANDATA_TAB))
     self.assertEqual(span.plaintext(), 'Line1\tLine2')
Exemple #12
0
 def test_plaintext_with_line_break(self):
     span = Span(xmlnode=etree.XML(SPANDATA_BRK))
     self.assertEqual(span.plaintext(), 'Line1\nLine2')
Exemple #13
0
 def test_plaintext_with_spaces(self):
     span = Span(xmlnode=etree.XML(SPANDATA_SPC))
     self.assertEqual(span.plaintext(), 'aliquyam    ')
Exemple #14
0
 def test_append_text(self):
     txt = "TEXT"
     span = Span(text=txt)
     self.assertEqual(span.text, txt)
     self.assertEqual(span.plaintext(), txt)
Exemple #15
0
 def test_plaintext(self):
     span = Span(xmlnode=etree.XML(SPANDATA))
     self.assertEqual(span.plaintext(), "aliquyam")