def test_get_presence(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn): for i in range(self.num_components): presence = component.get_presence(platform_api_conn, i) if self.expect(presence is not None, "Component {}: Unable to retrieve presence".format(i)): self.expect(isinstance(presence, bool), "Component {}: Presence appears incorrect".format(i)) # All components are expected to be present on DuT self.expect(presence is True, "Component {} not present".format(i)) self.assert_expectations()
def test_get_presence(self, duthost, localhost, platform_api_conn): if self.num_components == 0: pytest.skip("No components found on device") for i in range(self.num_components): presence = component.get_presence(platform_api_conn, i) if self.expect(presence is not None, "Component {}: Unable to retrieve presence".format(i)): self.expect(isinstance(presence, bool), "Component {}: Presence appears incorrect".format(i)) # All components are expected to be present on DuT self.expect(presence is True, "Component {} not present".format(i)) self.assert_expectations()