def test_IS_repetition_escape(self): i = IS('~repetition~') self.assertEqual(i.to_er7(), '\\R\\repetition\\R\\')
def test_IS_highlights(self): i = IS('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0, 11), (18, 24))) self.assertEqual(i.to_er7(), '\\H\\HIGHLIGHTED\\N\\TEXTIMP\\H\\ORTANT\\N\\')
def test_IS_component_escape(self): i = IS('^component^') self.assertEqual(i.to_er7(), '\\S\\component\\S\\')
def test_IS_subcomponent_escape(self): i = IS('&subcomponent&') self.assertEqual(i.to_er7(), '\\T\\subcomponent\\T\\')
def test_IS_maxlength_strict(self): is_str = 'a' * (IS(' ').max_length + 1) self.assertRaises(MaxLengthReached, IS, is_str, validation_level=VALIDATION_LEVEL.STRICT)
def test_IS_field_escaping(self): i = IS('|field|') self.assertEqual(i.to_er7(), '\\F\\field\\F\\')
def test_IS(self): is_str = 'This is a IS' is_obj = IS(is_str) self.assertEqual(is_obj.classname, ('IS')) self.assertEqual(is_obj.to_er7(), is_str)
def test_IS(self): is_str = 'This is a IS' is_obj = IS(is_str) self.assertEqual(is_obj.classname, 'IS') self.assertEqual(is_obj.to_er7(), is_str)