def test_config(test_case, init_config, extra_config, expected_http_kwargs):
    instance = deepcopy(INSTANCE_INTEGRATION)
    instance.update(extra_config)
    check = Marathon('marathon', init_config, 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://localhost:8080/v2/queue',
                                 **http_wargs)
Esempio n. 2
0
def check():
    return Marathon('marathon', {}, {}, [{}])
Esempio n. 3
0
def check():
    return Marathon('marathon', {}, [INSTANCE_INTEGRATION])