Пример #1
0
def test_config(test_case, extra_config, expected_http_kwargs):
    instance = extra_config
    check = FargateCheck('ecs_fargate', {}, instances=[instance])

    with mock.patch('datadog_checks.base.utils.http.requests') as r:
        r.get.return_value = mock.MagicMock(status_code=200)

        check.check(instance)

        http_wargs = dict(
            auth=mock.ANY, cert=mock.ANY, headers=mock.ANY, proxies=mock.ANY, timeout=mock.ANY, verify=mock.ANY
        )
        http_wargs.update(expected_http_kwargs)
        r.get.assert_called_with('http://169.254.170.2/v2/metadata', **http_wargs)
Пример #2
0
def check():
    return FargateCheck('ecs_fargate', {}, {})
Пример #3
0
def check():
    return FargateCheck('ecs_fargate', {}, [INSTANCE])