Exemple #1
0
 def test_ID_invalid_highlight_range(self):
     i = ID('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0, 11), (4, 24)))
     self.assertRaises(InvalidHighlightRange, i.to_er7)
     i = ID('HIGHLIGHTEDTEXTIMPORTANT', highlights=((4, 24), (0, 11)))
     self.assertRaises(InvalidHighlightRange, i.to_er7)
     i = ID('HIGHLIGHTEDTEXTIMPORTANT', highlights=((5, 11), (0, 11)))
     self.assertRaises(InvalidHighlightRange, i.to_er7)
     i = ID('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0, 11), (0, 4)))
     self.assertRaises(InvalidHighlightRange, i.to_er7)
Exemple #2
0
 def test_ID_highlights(self):
     i = ID('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0, 11), (18, 24)))
     self.assertEqual(i.to_er7(),
                      '\\H\\HIGHLIGHTED\\N\\TEXTIMP\\H\\ORTANT\\N\\')
Exemple #3
0
 def test_ID_subcomponent_escape(self):
     i = ID('&subcomponent&')
     self.assertEqual(i.to_er7(), '\\T\\subcomponent\\T\\')
Exemple #4
0
 def test_ID_repetition_escape(self):
     i = ID('~repetition~')
     self.assertEqual(i.to_er7(), '\\R\\repetition\\R\\')
Exemple #5
0
 def test_ID_field_escaping(self):
     i = ID('|field|')
     self.assertEqual(i.to_er7(), '\\F\\field\\F\\')
Exemple #6
0
 def test_ID_component_escape(self):
     i = ID('^component^')
     self.assertEqual(i.to_er7(), '\\S\\component\\S\\')
 def test_ID(self):
     id_str = 'This is a ID'
     id = ID(id_str)
     self.assertEqual(id.classname, ('ID'))
     self.assertEqual(id.to_er7(), id_str)
Exemple #8
0
 def test_ID(self):
     id_str = 'This is a ID'
     i = ID(id_str)
     self.assertEqual(i.classname, 'ID')
     self.assertEqual(i.to_er7(), id_str)
Exemple #9
0
 def test_ID_highlights(self):
     i = ID('HIGHLIGHTEDTEXTIMPORTANT', highlights=((0, 11), (18, 24)))
     self.assertEqual(i.to_er7(), '\\H\\HIGHLIGHTED\\N\\TEXTIMP\\H\\ORTANT\\N\\')
Exemple #10
0
 def test_ID(self):
     id_str = 'This is a ID'
     id = ID(id_str)
     self.assertEqual(id.classname, ('ID'))
     self.assertEqual(id.to_er7(), id_str)
Exemple #11
0
 def test_ID_repetition_escape(self):
     i = ID('~repetition~')
     self.assertEqual(i.to_er7(), '\\R\\repetition\\R\\')
Exemple #12
0
 def test_ID_subcomponent_escape(self):
     i = ID('&subcomponent&')
     self.assertEqual(i.to_er7(), '\\T\\subcomponent\\T\\')
Exemple #13
0
 def test_ID_component_escape(self):
     i = ID('^component^')
     self.assertEqual(i.to_er7(), '\\S\\component\\S\\')
Exemple #14
0
 def test_ID_field_escaping(self):
     i = ID('|field|')
     self.assertEqual(i.to_er7(), '\\F\\field\\F\\')
Exemple #15
0
 def test_ID(self):
     id_str = 'This is a ID'
     i = ID(id_str)
     self.assertEqual(i.classname, 'ID')
     self.assertEqual(i.to_er7(), id_str)