예제 #1
0
 def test_IS_repetition_escape(self):
     i = IS('~repetition~')
     self.assertEqual(i.to_er7(), '\\R\\repetition\\R\\')
예제 #2
0
 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\\')
예제 #3
0
 def test_IS_component_escape(self):
     i = IS('^component^')
     self.assertEqual(i.to_er7(), '\\S\\component\\S\\')
예제 #4
0
 def test_IS_subcomponent_escape(self):
     i = IS('&subcomponent&')
     self.assertEqual(i.to_er7(), '\\T\\subcomponent\\T\\')
예제 #5
0
 def test_IS_maxlength_strict(self):
     is_str = 'a' * (IS(' ').max_length + 1)
     self.assertRaises(MaxLengthReached,
                       IS,
                       is_str,
                       validation_level=VALIDATION_LEVEL.STRICT)
예제 #6
0
 def test_IS_field_escaping(self):
     i = IS('|field|')
     self.assertEqual(i.to_er7(), '\\F\\field\\F\\')
예제 #7
0
 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)
예제 #8
0
 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)
예제 #9
0
 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\\')
예제 #10
0
 def test_IS_repetition_escape(self):
     i = IS('~repetition~')
     self.assertEqual(i.to_er7(), '\\R\\repetition\\R\\')
예제 #11
0
 def test_IS_subcomponent_escape(self):
     i = IS('&subcomponent&')
     self.assertEqual(i.to_er7(), '\\T\\subcomponent\\T\\')
예제 #12
0
 def test_IS_component_escape(self):
     i = IS('^component^')
     self.assertEqual(i.to_er7(), '\\S\\component\\S\\')
예제 #13
0
 def test_IS_field_escaping(self):
     i = IS('|field|')
     self.assertEqual(i.to_er7(), '\\F\\field\\F\\')