Skip to content
Snippets Groups Projects
Commit 77efd29e authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Common - Type Checkers - Assertions:

- Corrected assertions for Endpoint
parent 31679c7e
No related branches found
No related tags found
2 merge requests!359Release TeraFlowSDN 5.0,!286Resolve "(CTTC) Implement integration test between E2E-IP-Optical SDN Controllers"
......@@ -15,6 +15,8 @@
import logging
from typing import Callable, Dict
from common.tools.grpc.Tools import grpc_message_to_json_string
LOGGER = logging.getLogger(__name__)
# ----- Enumerations ---------------------------------------------------------------------------------------------------
......@@ -472,7 +474,7 @@ def validate_topology(message, num_devices=None, num_links=None):
def validate_endpoint(message):
assert isinstance(message, dict)
assert len(message.keys()) == 6
assert len(message.keys()) in {5, 6}, 'Wrong number of attributes: {:s}'.format(str(message))
assert 'endpoint_id' in message
validate_endpoint_id(message['endpoint_id'])
assert 'name' in message
......@@ -482,10 +484,14 @@ def validate_endpoint(message):
assert 'kpi_sample_types' in message
assert isinstance(message['kpi_sample_types'], list)
for kpi_sample_type in message['kpi_sample_types']: validate_kpi_sample_types_enum(kpi_sample_type)
assert 'endpoint_location' in message
# TODO: validate "endpoint_location"
assert 'capabilities' in message
# TODO: validate "capabilities"
if 'endpoint_location' in message:
#assert 'endpoint_location' in message
# TODO: validate "endpoint_location"
pass
if 'capabilities' in message:
#assert 'capabilities' in message
# TODO: validate "capabilities"
pass
def validate_component(component):
assert isinstance(component, dict)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment