Skip to content

Commit

Permalink
[Platform API][Module] Use proper variable to index lists (#2551)
Browse files Browse the repository at this point in the history
Use proper variables to index lists of devices contained in modules
  • Loading branch information
jleveque authored Nov 19, 2020
1 parent d395b4b commit 7c5d15a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/platform_tests/api/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def test_components(self, duthost, localhost, platform_api_conn):

for comp_idx in range(num_components):
component = module.get_component(platform_api_conn, mod_idx, comp_idx)
self.expect(component and component == component_list[mod_idx], "Module {}: Component {} is incorrect".format(mod_idx, comp_idx))
self.expect(component and component == component_list[comp_idx], "Module {}: Component {} is incorrect".format(mod_idx, comp_idx))
self.assert_expectations()

def test_fans(self, duthost, localhost, platform_api_conn):
Expand All @@ -256,7 +256,7 @@ def test_fans(self, duthost, localhost, platform_api_conn):

for fan_idx in range(num_fans):
fan = module.get_fan(platform_api_conn, mod_idx, fan_idx)
self.expect(fan and fan == fan_list[mod_idx], "Module {}: Fan {} is incorrect".format(mod_idx, fan_idx))
self.expect(fan and fan == fan_list[fan_idx], "Module {}: Fan {} is incorrect".format(mod_idx, fan_idx))
self.assert_expectations()

def test_psus(self, duthost, localhost, platform_api_conn):
Expand All @@ -278,7 +278,7 @@ def test_psus(self, duthost, localhost, platform_api_conn):

for psu_idx in range(num_psus):
psu = module.get_psu(platform_api_conn, mod_idx, psu_idx)
self.expect(psu and psu == psu_list[mod_idx], "Module {}: PSU {} is incorrect".format(mod_idx, psu_idx))
self.expect(psu and psu == psu_list[psu_idx], "Module {}: PSU {} is incorrect".format(mod_idx, psu_idx))
self.assert_expectations()

def test_thermals(self, duthost, localhost, platform_api_conn):
Expand All @@ -300,7 +300,7 @@ def test_thermals(self, duthost, localhost, platform_api_conn):

for therm_idx in range(num_thermals):
thermal = module.get_thermal(platform_api_conn, mod_idx, therm_idx)
self.expect(thermal and thermal == thermal_list[mod_idx], "Thermal {} is incorrect".format(mod_idx, therm_idx))
self.expect(thermal and thermal == thermal_list[therm_idx], "Thermal {} is incorrect".format(mod_idx, therm_idx))
self.assert_expectations()

def test_sfps(self, duthost, localhost, platform_api_conn):
Expand All @@ -322,5 +322,5 @@ def test_sfps(self, duthost, localhost, platform_api_conn):

for sfp_idx in range(num_sfps):
sfp = module.get_sfp(platform_api_conn, mod_idx, sfp_idx)
self.expect(sfp and sfp == sfp_list[mod_idx], "Module {}: SFP {} is incorrect".format(mod_idx, sfp_idx))
self.expect(sfp and sfp == sfp_list[sfp_idx], "Module {}: SFP {} is incorrect".format(mod_idx, sfp_idx))
self.assert_expectations()

0 comments on commit 7c5d15a

Please sign in to comment.