Esempio n. 1
0
    def test_should_update_host_when_host_is_not_uptodate(self, components, action_plan, apply_instructions, dump_action_plan, action):
        components.return_value = create_component_pool_for_one_host(
            host_state=yadtshell.settings.UPDATE_NEEDED,
            next_artefacts_present=True)

        compare_versions()

        action.assert_called_with('update', 'host://foobar42', 'state', 'uptodate')
    def test_should_update_host_when_host_is_not_uptodate(self, components, action_plan, apply_instructions, dump_action_plan, action):
        components.return_value = create_component_pool_for_one_host(
            host_state=yadtshell.settings.UPDATE_NEEDED,
            next_artefacts_present=True)

        compare_versions()

        action.assert_called_with('update', 'host://foobar42', 'state', 'uptodate')
Esempio n. 3
0
    def test_should_not_update_anything_when_hosts_are_uptodate(self, components, action_plan, apply_instructions, dump_action_plan):
        components.return_value = create_component_pool_for_one_host(
            host_state=yadtshell.settings.UPTODATE)

        compare_versions()

        dump_action_plan.assert_called_with('update', action_plan.return_value)
        action_plan.assert_called_with('start', set([]))
    def test_should_not_update_anything_when_hosts_are_uptodate(self, components, action_plan, apply_instructions, dump_action_plan):
        components.return_value = create_component_pool_for_one_host(
            host_state=yadtshell.settings.UPTODATE)

        compare_versions()

        dump_action_plan.assert_called_with('update', action_plan.return_value)
        action_plan.assert_called_with('start', set([]))