@@ -78,10 +78,11 @@ def test_read_port_mappings(self):
7878 sfputil_helper .read_porttab_mappings (self .port_config_file , 0 )
7979
8080 logical_port_list = sfputil_helper .logical
81+
8182 assert len (logical_port_list ) == len (PORT_LIST )
8283
83- for logical_port_name in logical_port_list :
84- assert logical_port_name in PORT_LIST
84+ for logical_port , port in zip ( logical_port_list , PORT_LIST ) :
85+ assert logical_port == port
8586
8687
8788 @mock .patch ('portconfig.get_hwsku_file_name' , mock .MagicMock (return_value = hwsku_json_file ))
@@ -90,28 +91,30 @@ def test_read_all_port_mappings(self):
9091 sfputil_helper = sfputilhelper .SfpUtilHelper ()
9192 sfputil_helper .logical = []
9293 sfputil_helper .logical_to_physical = {}
93- sfputil_helper .physical_to_logica = {}
94+ sfputil_helper .physical_to_logical = {}
9495 sfputil_helper .read_all_porttab_mappings (self .platform_dir , 2 )
9596 logical_port_list = sfputil_helper .logical
9697
9798 assert len (logical_port_list ) == len (PORT_LIST )
98- for logical_port_name in logical_port_list :
99- assert logical_port_name in PORT_LIST
99+
100+ for logical_port , port in zip (logical_port_list , PORT_LIST ):
101+ assert logical_port == port
102+
100103 assert sfputil_helper .logical_to_physical == LOGICAL_TO_PHYSICAL
101104 assert sfputil_helper .physical_to_logical == PHYSICAL_TO_LOGICAL
102105
103106 # test platform.json case
104107
105108 sfputil_helper .logical = []
106109 sfputil_helper .logical_to_physical = {}
107- sfputil_helper .physical_to_logica = {}
110+ sfputil_helper .physical_to_logical = {}
108111 sfputil_helper .read_all_porttab_mappings (self .platform_json_dir , 2 )
109112 logical_port_list = sfputil_helper .logical
110113
111114 assert len (logical_port_list ) == len (PORT_LIST )
112115
113- for logical_port_name in logical_port_list :
114- assert logical_port_name in PORT_LIST
116+ for logical_port , port in zip ( logical_port_list , PORT_LIST ) :
117+ assert logical_port == port
115118
116119 assert sfputil_helper .logical_to_physical == LOGICAL_TO_PHYSICAL
117120 assert sfputil_helper .physical_to_logical == PHYSICAL_TO_LOGICAL
0 commit comments