Пример #1
0
 def test_apply_pygments_without_lexer(self):
     """Testing RawDiffChunkGenerator._apply_pygments without valid lexer"""
     chunk_generator = RawDiffChunkGenerator(old=[],
                                             new=[],
                                             orig_filename='file1',
                                             modified_filename='file2')
     self.assertIsNone(
         chunk_generator._apply_pygments(data='This is **bold**',
                                         filename='test'))
Пример #2
0
 def test_apply_pygments_with_lexer(self):
     """Testing RawDiffChunkGenerator._apply_pygments with valid lexer"""
     chunk_generator = RawDiffChunkGenerator(old=[],
                                             new=[],
                                             orig_filename='file1',
                                             modified_filename='file2')
     self.assertEqual(
         chunk_generator._apply_pygments(data='This is **bold**\n',
                                         filename='test.md'),
         ['This is <span class="gs">**bold**</span>'])