def test_GTS_highlights(self): gts = GTS('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0, 11), (18, 24))) self.assertEqual(gts.to_er7(), '\\H\\HIGHLIGHTED\\N\\TEXTIMP\\H\\ORTANT\\N\\')
def test_GTS_subcomponent_escape(self): gts = GTS('&subcomponent&') self.assertEqual(gts.to_er7(), '\\T\\subcomponent\\T\\')
def test_GTS_repetition_escape(self): gts = GTS('~repetition~') self.assertEqual(gts.to_er7(), '\\R\\repetition\\R\\')
def test_GTS_field_escaping(self): gts = GTS('|field|') self.assertEqual(gts.to_er7(), '\\F\\field\\F\\')
def test_GTS_component_escape(self): gts = GTS('^component^') self.assertEqual(gts.to_er7(), '\\S\\component\\S\\')
def test_GTS_highlights(self): gts = GTS('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0,11), (18,24))) self.assertEqual(gts.to_er7(), '\\H\\HIGHLIGHTED\\N\\TEXTIMP\\H\\ORTANT\\N\\')
def test_GTS(self): text = 'This is a GTS datatype text' gts = GTS(text) self.assertEqual(gts.classname, 'GTS') self.assertEqual(gts.to_er7(), text)