def test_can_call_no_processors(self): processor = package.CompositePostProcessor([]) template = {} config = mock.MagicMock(spec=Config) processor.process(template, config, 'out', 'dev') assert template == {}
def test_does_call_processors_once(self): mock_processor_a = mock.Mock(spec=package.TemplatePostProcessor) mock_processor_b = mock.Mock(spec=package.TemplatePostProcessor) processor = package.CompositePostProcessor( [mock_processor_a, mock_processor_b]) template = {} config = mock.MagicMock(spec=Config) processor.process(template, config, 'out', 'dev') mock_processor_a.process.assert_called_once_with( template, config, 'out', 'dev') mock_processor_b.process.assert_called_once_with( template, config, 'out', 'dev')