Пример #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)
Пример #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\\')
Пример #3
0
 def test_ID_subcomponent_escape(self):
     i = ID('&subcomponent&')
     self.assertEqual(i.to_er7(), '\\T\\subcomponent\\T\\')
Пример #4
0
 def test_ID_repetition_escape(self):
     i = ID('~repetition~')
     self.assertEqual(i.to_er7(), '\\R\\repetition\\R\\')
Пример #5
0
 def test_ID_field_escaping(self):
     i = ID('|field|')
     self.assertEqual(i.to_er7(), '\\F\\field\\F\\')
Пример #6
0
 def test_ID_component_escape(self):
     i = ID('^component^')
     self.assertEqual(i.to_er7(), '\\S\\component\\S\\')
Пример #7
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)
Пример #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)
Пример #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\\')
Пример #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)
Пример #11
0
 def test_ID_repetition_escape(self):
     i = ID('~repetition~')
     self.assertEqual(i.to_er7(), '\\R\\repetition\\R\\')
Пример #12
0
 def test_ID_subcomponent_escape(self):
     i = ID('&subcomponent&')
     self.assertEqual(i.to_er7(), '\\T\\subcomponent\\T\\')
Пример #13
0
 def test_ID_component_escape(self):
     i = ID('^component^')
     self.assertEqual(i.to_er7(), '\\S\\component\\S\\')
Пример #14
0
 def test_ID_field_escaping(self):
     i = ID('|field|')
     self.assertEqual(i.to_er7(), '\\F\\field\\F\\')
Пример #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)