Files
test/keywords/ptp/setup/object/port_data_set.py
Guntaka Umashankar Reddy 3676085c8e Verify PTP operation and status change when an interface and SMA.
Change-Id: I7e0497e817939bb8af4212eb10b8f7b5a26d75c8
Signed-off-by: Guntaka Umashankar Reddy <umashankarguntaka.reddy@windriver.com>
2025-05-20 05:22:10 -04:00

56 lines
1.4 KiB
Python

from typing import Any, Dict
class PortDataSet:
"""
Class models a port data set
"""
def __init__(self, expected_dict: Dict[str, Any]):
"""
Constructor.
Args:
expected_dict (Dict[str, Any]): The dictionary read from the JSON setup template file associated with this port data set
"""
self.port_identity = None
if "interface" in expected_dict:
self.interface = expected_dict["interface"]
self.port_state = None
if "port_state" in expected_dict:
port_state = expected_dict["port_state"]
self.port_state = port_state if isinstance(port_state, list) else [port_state]
self.parent_port_identity = None
if "parent_port_identity" in expected_dict:
self.parent_port_identity = expected_dict["parent_port_identity"]
def get_interface(self) -> str:
"""
Gets the interface.
Returns:
str: The interface.
"""
return self.interface
def get_port_state(self) -> list:
"""
Gets the port state.
Returns:
list: The port state.
"""
return self.port_state
def get_parent_port_identity(self) -> str:
"""
Gets the parent port identity.
Returns:
str: The parent port identity.
"""
return self.parent_port_identity