diff --git a/src/forecaster/tests/Tools.py b/src/forecaster/tests/Tools.py index 9968eaea998bd53d1fc9b0290647d5a93ac0a29e..d55d1e5dedc98d51e2f122dd5150bf7fb5e7df55 100644 --- a/src/forecaster/tests/Tools.py +++ b/src/forecaster/tests/Tools.py @@ -56,7 +56,7 @@ def read_csv(csv_file : str) -> pandas.DataFrame: return df -def compose_descriptors(df : pandas.DataFrame) -> Dict: +def compose_descriptors(df : pandas.DataFrame, num_client_endpoints : int = 0) -> Dict: devices = dict() links = dict() @@ -72,11 +72,17 @@ def compose_descriptors(df : pandas.DataFrame) -> Dict: dst_port_uuid = row.source if src_device_uuid not in devices: - devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': set()} + endpoints = set() + for num_client_endpoint in range(num_client_endpoints): + endpoints.add('client:{:d}'.format(num_client_endpoint)) + devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': endpoints} devices[src_device_uuid]['endpoints'].add(src_port_uuid) if dst_device_uuid not in devices: - devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': set()} + endpoints = set() + for num_client_endpoint in range(num_client_endpoints): + endpoints.add('client:{:d}'.format(num_client_endpoint)) + devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': endpoints} devices[dst_device_uuid]['endpoints'].add(dst_port_uuid) if link_uuid not in links: