Exemplo n.º 1
0
 def test_cancel_before_processing(self):
     self.publisher.repo.content_unit_counts = {'FOO_TYPE': 2}
     step = PublishStep('foo_step')
     step.is_skipped = Mock()
     step.cancel()
     step.process()
     self.assertEquals(0, step.is_skipped.call_count)
Exemplo n.º 2
0
    def test_process_lifecycle(self):
        step = PublishStep('parent')
        step.process = Mock()
        child_step = PublishStep('child')
        child_step.process = Mock()
        step.add_child(child_step)
        step.report_progress = Mock()

        step.process_lifecycle()

        step.process.assert_called_once_with()
        child_step.process.assert_called_once_with()
        step.report_progress.assert_called_once_with(force=True)
Exemplo n.º 3
0
    def test_process_lifecycle_reports_on_error(self):
        step = PublishStep('parent')
        step.process = Mock(side_effect=Exception('Foo'))
        step.report_progress = Mock()

        self.assertRaises(Exception, step.process_lifecycle)

        step.report_progress.assert_called_once_with(force=True)