Exemple #1
0
 def test_add_child(self):
     step = publish_step.Step('foo')
     step2 = publish_step.Step('step2')
     step3 = publish_step.Step('step3')
     step.add_child(step2)
     step.add_child(step3)
     self.assertEquals(step.children, [step2, step3])
Exemple #2
0
 def test_report_progress_disable_reporting(self):
     """
     Test that we can disable reporting when calling report_progress()
     """
     step = publish_step.Step('foo_step', disable_reporting=True)
     step.status_conduit = Mock()
     step.report_progress()
     self.assertFalse(step.status_conduit.report_progress.called)
Exemple #3
0
    def test_progress_overflow_prevention(self):
        step = publish_step.Step('foo_step', disable_reporting=True)
        # ensure the step still defaults to 1
        self.assertEqual(step.get_total(), 1)
        step.progress_successes = 1

        step._process_block()

        # make sure progress does not get incremented beyond the total
        self.assertEqual(step.progress_successes, 1)
Exemple #4
0
    def test_increments_progress(self):
        step = publish_step.Step('foo_step', disable_reporting=True)

        step._process_block()

        self.assertEqual(step.progress_successes, 1)
Exemple #5
0
 def test__get_total(self):
     step = publish_step.Step('foo_step')
     step.get_total = Mock(return_value=3)
     self.assertEquals(3, step._get_total())
Exemple #6
0
 def test_get_total(self):
     step = publish_step.Step('foo_step')
     self.assertEquals(1, step.get_total())
Exemple #7
0
 def test_get_status_conduit_from_parent(self):
     step = publish_step.Step('foo_step')
     step.parent = Mock()
     step.parent.get_status_conduit.return_value = 'foo'
     self.assertEquals('foo', step.get_status_conduit())
Exemple #8
0
 def test_get_status_conduit(self):
     step = publish_step.Step('foo_step')
     step.status_conduit = 'foo'
     self.assertEquals('foo', step.get_status_conduit())