예제 #1
0
 def test_TX_highlights(self):
     tx = TX('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0, 11), (18, 24)))
     self.assertEqual(tx.to_er7(),
                      '\\H\\HIGHLIGHTED\\N\\TEXTIMP\\H\\ORTANT\\N\\')
예제 #2
0
 def test_TX_subcomponent_escape(self):
     tx = TX('&subcomponent&')
     self.assertEqual(tx.to_er7(), '\\T\\subcomponent\\T\\')
예제 #3
0
 def test_TX_repetition_escape(self):
     tx = TX('~repetition~')
     self.assertEqual(tx.to_er7(), '\\R\\repetition\\R\\')
예제 #4
0
 def test_TX_field_escaping(self):
     tx = TX('|field|')
     self.assertEqual(tx.to_er7(), '\\F\\field\\F\\')
예제 #5
0
 def test_TX_component_escape(self):
     tx = TX('^component^')
     self.assertEqual(tx.to_er7(), '\\S\\component\\S\\')
예제 #6
0
 def test_TX_highlights(self):
     tx = TX('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0,11), (18,24)))
     self.assertEqual(tx.to_er7(), '\\H\\HIGHLIGHTED\\N\\TEXTIMP\\H\\ORTANT\\N\\')
예제 #7
0
 def test_TX(self):
     text = 'This is a TX datatype text'
     tx = TX(text)
     self.assertEqual(tx.classname, 'TX')
     self.assertEqual(tx.to_er7(), text)
예제 #8
0
 def test_TX_repetition_escape(self):
     tx = TX('~repetition~')
     self.assertEqual(tx.to_er7(), '\\R\\repetition\\R\\')
예제 #9
0
 def test_TX_subcomponent_escape(self):
     tx = TX('&subcomponent&')
     self.assertEqual(tx.to_er7(), '\\T\\subcomponent\\T\\')
예제 #10
0
 def test_TX_component_escape(self):
     tx = TX('^component^')
     self.assertEqual(tx.to_er7(), '\\S\\component\\S\\')
예제 #11
0
 def test_TX_field_escaping(self):
     tx = TX('|field|')
     self.assertEqual(tx.to_er7(), '\\F\\field\\F\\')
예제 #12
0
 def test_TX(self):
     text = 'This is a TX datatype text'
     tx = TX(text)
     self.assertEqual(tx.classname, ('TX'))
     self.assertEqual(tx.to_er7(), text)