class TestTransitionNoParent(unittest.TestCase):
    def setUp(self):
        self._transition = Transition()
        self._transition._do_transition = Mock(return_value = None)

    def test_init(self):
        # No parents, so the rerun triggered by __init__ should to nothing.
        self._transition._do_transition.assert_not_called()

    def test_trigger_update(self):
        update = DataCheckpoint()
        update.append('abc')
        self._transition.trigger_update({'no-parent':update})
        self._transition._do_transition.assert_called_once_with((update,))

    def test_trigger_update_composite(self):
        update = CompositeCheckpoint(DataCheckpoint, 2)
        update.append(['abc','def'])
        self._transition.trigger_update({'no-parent':update})
        calls = [call((update[0],)), call((update[1],))]
        self._transition._do_transition.assert_has_calls(calls)

    def test_trigger_rerun(self):
        # No parents, so rerun should do nothing.
        self._transition.trigger_rerun()
        self._transition._do_transition.assert_not_called()