From df73437062d94f6b2e7ad556a3805f72bbfe3e70 Mon Sep 17 00:00:00 2001 From: Radu Carpa Date: Mon, 20 Nov 2023 15:44:40 +0100 Subject: [PATCH] wip --- tests/test_request.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_request.py b/tests/test_request.py index 7f811a6b0f..6a9838727b 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -286,3 +286,18 @@ def check_error_api(params, exception_class, exception_message, code): params = {'request_states': 'S', 'src_site': source_site, 'dst_site': 'unknown'} check_error_api(params, 'NotFound', 'Could not resolve site name unknown to RSE', 404) + + +def test_api_stats( + vo, + rest_client, + auth_token, + rse_factory, + root_account +): + api_endpoint = '/requests/stats' + source_rse, source_rse_id = rse_factory.make_mock_rse() + dest_rse, dest_rse_id = rse_factory.make_mock_rse() + params = {'state': 'Q', 'dst_rse': dest_rse, 'src_rse': source_rse} + headers_dict = {'X-Rucio-Type': 'user', 'X-Rucio-Account': root_account.external} + response = rest_client.get(api_endpoint, query_string=params, headers=headers(auth(auth_token), vohdr(vo), hdrdict(headers_dict)))