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\\')
def test_TX_subcomponent_escape(self): tx = TX('&subcomponent&') self.assertEqual(tx.to_er7(), '\\T\\subcomponent\\T\\')
def test_TX_repetition_escape(self): tx = TX('~repetition~') self.assertEqual(tx.to_er7(), '\\R\\repetition\\R\\')
def test_TX_field_escaping(self): tx = TX('|field|') self.assertEqual(tx.to_er7(), '\\F\\field\\F\\')
def test_TX_component_escape(self): tx = TX('^component^') self.assertEqual(tx.to_er7(), '\\S\\component\\S\\')
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\\')
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)
def test_TX_repetition_escape(self): tx = TX('~repetition~') self.assertEqual(tx.to_er7(), '\\R\\repetition\\R\\')
def test_TX_subcomponent_escape(self): tx = TX('&subcomponent&') self.assertEqual(tx.to_er7(), '\\T\\subcomponent\\T\\')
def test_TX_component_escape(self): tx = TX('^component^') self.assertEqual(tx.to_er7(), '\\S\\component\\S\\')
def test_TX_field_escaping(self): tx = TX('|field|') self.assertEqual(tx.to_er7(), '\\F\\field\\F\\')
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)