Beispiel #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, discogroup=MagicMock())
     aws.create_scaling_schedule("1", "2", "5", hostclass="mhcboo")
     aws.discogroup.assert_has_calls([
         call.delete_all_recurring_group_actions(hostclass='mhcboo', group_name=None)
     ])
Beispiel #2
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, discogroup=MagicMock())
     aws.create_scaling_schedule("1", "2", "5", hostclass="mhcboo")
     aws.discogroup.assert_has_calls([
         call.delete_all_recurring_group_actions(hostclass='mhcboo', group_name=None)
     ])
Beispiel #3
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')])
Beispiel #4
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)
Beispiel #5
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, discogroup=MagicMock())
     aws.create_scaling_schedule("1", "2@1 0 * * *:3@6 0 * * *", "5", hostclass="mhcboo")
     aws.discogroup.assert_has_calls([
         call.delete_all_recurring_group_actions(hostclass='mhcboo', group_name=None),
         call.create_recurring_group_action('1 0 * * *', hostclass='mhcboo', group_name=None,
                                            min_size=None, desired_capacity=2, max_size=None),
         call.create_recurring_group_action('6 0 * * *', hostclass='mhcboo', group_name=None,
                                            min_size=None, desired_capacity=3, max_size=None)
     ], any_order=True)
Beispiel #6
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, discogroup=MagicMock())
     aws.create_scaling_schedule("1", "2@1 0 * * *:3@6 0 * * *", "5", hostclass="mhcboo")
     aws.discogroup.assert_has_calls([
         call.delete_all_recurring_group_actions(hostclass='mhcboo', group_name=None),
         call.create_recurring_group_action('1 0 * * *', hostclass='mhcboo', group_name=None,
                                            min_size=None, desired_capacity=2, max_size=None),
         call.create_recurring_group_action('6 0 * * *', hostclass='mhcboo', group_name=None,
                                            min_size=None, desired_capacity=3, max_size=None)
     ], any_order=True)
Beispiel #7
0
 def test_create_scaling_schedule_overlapping(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@6 0 * * *",
                                 "2@1 0 * * *:3@6 0 * * *",
                                 "6@1 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=6),
         call.create_recurring_group_action('mhcboo', '6 0 * * *',
                                            min_size=2, desired_capacity=3, max_size=9)
     ], any_order=True)
Beispiel #8
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')])