def test_set_limit_overrides_ta(self):
     limits = sample_limits()
     self.mock_svc1.get_limits.return_value = limits["SvcFoo"]
     self.mock_svc2.get_limits.return_value = limits["SvcBar"]
     overrides = {"SvcBar": {"bar limit2": 100}, "SvcFoo": {"foo limit3": 3}}
     self.cls.set_limit_overrides(overrides, override_ta=False)
     assert self.mock_svc1.mock_calls == [call.set_limit_override("foo limit3", 3, override_ta=False)]
     assert self.mock_svc2.mock_calls == [call.set_limit_override("bar limit2", 100, override_ta=False)]
Beispiel #2
0
 def test_set_limit_overrides(self):
     overrides = {
         'EC2/Foo bar': "2",
         'ElastiCache/Cache cluster subnet groups': "100",
     }
     mock_checker = Mock(spec_set=AwsLimitChecker)
     self.cls.checker = mock_checker
     self.cls.set_limit_overrides(overrides)
     assert mock_checker.mock_calls == [
         call.set_limit_override('EC2', 'Foo bar', 2),
         call.set_limit_override('ElastiCache',
                                 'Cache cluster subnet groups', 100)
     ]
 def test_set_limit_override(self):
     limits = sample_limits()
     self.mock_svc1.get_limits.return_value = limits['SvcFoo']
     self.cls.set_limit_override('SvcFoo', 'foo limit3', 99)
     assert self.mock_svc1.mock_calls == [
         call.set_limit_override('foo limit3', 99, override_ta=True)
     ]
 def test_set_limit_overrides(self):
     overrides = {
         'EC2/Foo bar': "2",
         'ElastiCache/Cache cluster subnet groups': "100",
     }
     mock_checker = Mock(spec_set=AwsLimitChecker)
     self.cls.checker = mock_checker
     self.cls.set_limit_overrides(overrides)
     assert mock_checker.mock_calls == [
         call.set_limit_override('EC2', 'Foo bar', 2),
         call.set_limit_override(
             'ElastiCache',
             'Cache cluster subnet groups',
             100
         )
     ]
Beispiel #5
0
 def test_set_limit_override(self):
     limits = sample_limits()
     self.mock_svc1.get_limits.return_value = limits['SvcFoo']
     self.cls.set_limit_override('SvcFoo', 'foo limit3', 99)
     assert self.mock_svc1.mock_calls == [
         call.set_limit_override('foo limit3', 99, override_ta=True)
     ]
Beispiel #6
0
 def test_set_limit_override(self):
     mock_limit = Mock(spec_set=AwsLimit)
     type(mock_limit).default_limit = 5
     cls = AwsServiceTester(1, 2)
     cls.limits['foo'] = mock_limit
     cls.set_limit_override('foo', 10)
     assert mock_limit.mock_calls == [
         call.set_limit_override(10, override_ta=True)
     ]
Beispiel #7
0
 def test_set_limit_override(self):
     mock_limit = Mock(spec_set=AwsLimit)
     type(mock_limit).default_limit = 5
     cls = AwsServiceTester(1, 2)
     cls.limits['foo'] = mock_limit
     cls.set_limit_override('foo', 10)
     assert mock_limit.mock_calls == [
         call.set_limit_override(10, override_ta=True)
     ]
 def test_set_limit_overrides_ta(self):
     limits = sample_limits()
     self.mock_svc1.get_limits.return_value = limits['SvcFoo']
     self.mock_svc2.get_limits.return_value = limits['SvcBar']
     overrides = {
         'SvcBar': {
             'bar limit2': 100,
         },
         'SvcFoo': {
             'foo limit3': 3,
         },
     }
     self.cls.set_limit_overrides(overrides, override_ta=False)
     assert self.mock_svc1.mock_calls == [
         call.set_limit_override('foo limit3', 3, override_ta=False)
     ]
     assert self.mock_svc2.mock_calls == [
         call.set_limit_override('bar limit2', 100, override_ta=False)
     ]
Beispiel #9
0
 def test_set_limit_overrides_ta(self):
     limits = sample_limits()
     self.mock_svc1.get_limits.return_value = limits['SvcFoo']
     self.mock_svc2.get_limits.return_value = limits['SvcBar']
     overrides = {
         'SvcBar': {
             'bar limit2': 100,
         },
         'SvcFoo': {
             'foo limit3': 3,
         },
     }
     self.cls.set_limit_overrides(overrides, override_ta=False)
     assert self.mock_svc1.mock_calls == [
         call.set_limit_override('foo limit3', 3, override_ta=False)
     ]
     assert self.mock_svc2.mock_calls == [
         call.set_limit_override('bar limit2', 100, override_ta=False)
     ]
 def test_set_limit_override_ta(self):
     limits = sample_limits()
     self.mock_svc1.get_limits.return_value = limits["SvcFoo"]
     self.cls.set_limit_override("SvcFoo", "foo limit3", 99, override_ta=False)
     assert self.mock_svc1.mock_calls == [call.set_limit_override("foo limit3", 99, override_ta=False)]