示例#1
0
def test_fetch_worker_statistics(request):
    resp = create_mock_json(
        'tests/resources/task_router/workers_statistics_instance.json')
    resp.status_code = 200
    request.return_value = resp

    workers = Workers(BASE_URI, AUTH, TIMEOUT)
    worker = Worker(workers, 'WK123')
    worker.load_subresources()
    worker.statistics.get()
    request.assert_called_with(
        'GET',
        '{0}/Workers/WK123/Statistics'.format(BASE_URI),
        params={},
        auth=AUTH,
        timeout=TIMEOUT,
        use_json_extension=False,
    )