Exemplo n.º 1
0
 def test_create_scaling_schedule_no_sched(self, mock_config, **kwargs):
     """test create_scaling_schedule with only desired schedule"""
     aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME)
     aws.autoscale = MagicMock()
     aws.create_scaling_schedule("mhcboo", "1", "2", "5")
     aws.autoscale.assert_has_calls(
         [call.delete_all_recurring_group_actions('mhcboo')])
Exemplo n.º 2
0
 def test_create_scaling_schedule_mixed(self, mock_config, **kwargs):
     """test create_scaling_schedule with only desired schedule"""
     aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME)
     aws.autoscale = MagicMock()
     aws.create_scaling_schedule("mhcboo", "1@1 0 * * *:2@7 0 * * *",
                                 "2@1 0 * * *:3@6 0 * * *",
                                 "6@2 0 * * *:9@6 0 * * *")
     aws.autoscale.assert_has_calls([
         call.delete_all_recurring_group_actions('mhcboo'),
         call.create_recurring_group_action('mhcboo',
                                            '1 0 * * *',
                                            min_size=1,
                                            desired_capacity=2,
                                            max_size=None),
         call.create_recurring_group_action('mhcboo',
                                            '2 0 * * *',
                                            min_size=None,
                                            desired_capacity=None,
                                            max_size=6),
         call.create_recurring_group_action('mhcboo',
                                            '6 0 * * *',
                                            min_size=None,
                                            desired_capacity=3,
                                            max_size=9),
         call.create_recurring_group_action('mhcboo',
                                            '7 0 * * *',
                                            min_size=2,
                                            desired_capacity=None,
                                            max_size=None)
     ],
                                    any_order=True)
Exemplo n.º 3
0
 def test_create_scaling_schedule_only_desired(self, mock_config, **kwargs):
     """test create_scaling_schedule with only desired schedule"""
     aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME)
     aws.autoscale = MagicMock()
     aws.create_scaling_schedule("mhcboo", "1", "2@1 0 * * *:3@6 0 * * *", "5")
     aws.autoscale.assert_has_calls([
         call.delete_all_recurring_group_actions('mhcboo'),
         call.create_recurring_group_action('mhcboo', '1 0 * * *',
                                            min_size=None, desired_capacity=2, max_size=None),
         call.create_recurring_group_action('mhcboo', '6 0 * * *',
                                            min_size=None, desired_capacity=3, max_size=None)
     ], any_order=True)
Exemplo n.º 4
0
 def test_create_scaling_schedule_no_sched(self, mock_config, **kwargs):
     """test create_scaling_schedule with only desired schedule"""
     aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME)
     aws.autoscale = MagicMock()
     aws.create_scaling_schedule("mhcboo", "1", "2", "5")
     aws.autoscale.assert_has_calls([call.delete_all_recurring_group_actions('mhcboo')])