Exemplo n.º 1
0
    def test_set_autoscale_parameters_with_empty_bootstrap_context_and_no_parameters(self):  # NOQA

        # Default values should be populated.

        cloudify_agent = {}
        ctx = MockCloudifyContext(bootstrap_context={})
        set_bootstrap_context_parameters(
            ctx.bootstrap_context,
            cloudify_agent)
        self.assertEqual(cloudify_agent[MAX_WORKERS_KEY], 5)
        self.assertEqual(cloudify_agent[MIN_WORKERS_KEY], 2)
Exemplo n.º 2
0
    def test_set_autoscale_parameters_with_empty_bootstrap_context_and_empty_cloudify_agent(self):  # NOQA

        from windows_agent_installer import set_bootstrap_context_parameters

        # cloudify agent does not contain any
        # auto scale configuration parameters.
        # bootstrap_context does not contain any
        # auto scale configuration parameters.
        # this means all parameters should be the default ones.
        cloudify_agent = {}
        ctx = MockCloudifyContext(bootstrap_context={})
        set_bootstrap_context_parameters(
            ctx.bootstrap_context,
            cloudify_agent)
        self.assertEqual(cloudify_agent[constants.MAX_WORKERS_KEY], 5)
        self.assertEqual(cloudify_agent[constants.MIN_WORKERS_KEY], 2)