本文整理汇总了Python中awslimitchecker.limit.AwsLimit._set_ta_unlimited方法的典型用法代码示例。如果您正苦于以下问题:Python AwsLimit._set_ta_unlimited方法的具体用法?Python AwsLimit._set_ta_unlimited怎么用?Python AwsLimit._set_ta_unlimited使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类awslimitchecker.limit.AwsLimit
的用法示例。
在下文中一共展示了AwsLimit._set_ta_unlimited方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_set_ta_unlimited
# 需要导入模块: from awslimitchecker.limit import AwsLimit [as 别名]
# 或者: from awslimitchecker.limit.AwsLimit import _set_ta_unlimited [as 别名]
def test_set_ta_unlimited(self):
limit = AwsLimit(
'limitname',
self.mock_svc,
3,
1,
2
)
assert limit.ta_limit is None
assert limit.ta_unlimited is False
limit._set_ta_unlimited()
assert limit.ta_limit is None
assert limit.ta_unlimited is True
示例2: test_check_thresholds_ta_unlimited
# 需要导入模块: from awslimitchecker.limit import AwsLimit [as 别名]
# 或者: from awslimitchecker.limit.AwsLimit import _set_ta_unlimited [as 别名]
def test_check_thresholds_ta_unlimited(self):
limit = AwsLimit('limitname', self.mock_svc, 3, 1, 2)
u1 = AwsLimitUsage(limit, 4, resource_id='foo4bar')
u2 = AwsLimitUsage(limit, 3, resource_id='foo3bar')
u3 = AwsLimitUsage(limit, 2, resource_id='foo2bar')
limit._current_usage = [u1, u2, u3]
limit._set_ta_unlimited()
with patch('awslimitchecker.limit.AwsLimit.'
'_get_thresholds') as mock_get_thresh:
with patch('awslimitchecker.limit.AwsLimit.get_'
'limit') as mock_get_limit:
mock_get_thresh.return_value = (None, 40, None, 80)
mock_get_limit.return_value = None
res = limit.check_thresholds()
assert res is True
assert limit._warnings == []
assert limit._criticals == []
assert mock_get_thresh.mock_calls == []
assert mock_get_limit.mock_calls == [call()]
示例3: test_get_limit_source_ta_unlimited
# 需要导入模块: from awslimitchecker.limit import AwsLimit [as 别名]
# 或者: from awslimitchecker.limit.AwsLimit import _set_ta_unlimited [as 别名]
def test_get_limit_source_ta_unlimited(self):
limit = AwsLimit('limitname', self.mock_svc, 3, 1, 2)
limit._set_ta_unlimited()
assert limit.get_limit_source() == SOURCE_TA
示例4: test_get_limit_ta_unlimited
# 需要导入模块: from awslimitchecker.limit import AwsLimit [as 别名]
# 或者: from awslimitchecker.limit.AwsLimit import _set_ta_unlimited [as 别名]
def test_get_limit_ta_unlimited(self):
limit = AwsLimit('limitname', self.mock_svc, 3, 1, 2)
limit.set_limit_override(55, override_ta=False)
limit._set_ta_unlimited()
assert limit.get_limit() is None