def test_unique_custom_processors(self): '''Checks if unique processors are stored when duplicates provided. ''' processors = ['comment', 'comment', 'comment'] verto = Verto(processors=processors) self.assertEqual(verto.verto_extension.processors, set(processors)) processors = list(Verto.processor_defaults()) processors.append('example_processor') processors.append('example_processor') processors.append('example_processor') verto.update_processors(processors) self.assertTrue(verto.verto_extension.processors, processors)
def test_custom_processors_after_creation(self): '''Checks if extension correct changes processors. ''' verto = Verto() processors = Verto.processor_defaults() processors.add('example_processor') processors.remove('comment') verto.update_processors(processors) # Check example_processor is now stored in extension processors self.assertEqual(verto.verto_extension.processors, processors) # Check comments are now skipped test_string = self.read_test_file(self.test_name, 'all_processors.md') converted_test_string = verto.convert(test_string).html_string expected_string = self.read_test_file(self.test_name, 'all_processors_except_comment_expected.html', strip=True) self.assertEqual(expected_string, converted_test_string)
def test_custom_processors_after_creation(self): '''Checks if extension correct changes processors. ''' verto = Verto() processors = Verto.processor_defaults() processors.add('example_processor') processors.remove('comment') verto.update_processors(processors) # Check example_processor is now stored in extension processors self.assertEqual(verto.verto_extension.processors, processors) # Check comments are now skipped test_string = self.read_test_file(self.test_name, 'all_processors.md') converted_test_string = verto.convert(test_string).html_string expected_string = self.read_test_file( self.test_name, 'all_processors_except_comment_expected.html', strip=True) self.assertEqual(expected_string, converted_test_string)