Пример #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)