def test_get_presence(self, duthost, localhost, platform_api_conn): for i in range(self.num_psus): presence = psu.get_presence(platform_api_conn, i) if self.expect(presence is not None, "Unable to retrieve PSU {} presence".format(i)): if self.expect(isinstance(presence, bool), "PSU {} presence appears incorrect".format(i)): self.expect(presence is True, "PSU {} is not present".format(i)) self.assert_expectations()
def test_get_presence(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn): for i in range(self.num_psus): presence = psu.get_presence(platform_api_conn, i) name = psu.get_name(platform_api_conn, i) if self.expect(presence is not None, "Unable to retrieve PSU {} presence".format(i)): if self.expect(isinstance(presence, bool), "PSU {} presence appears incorrect".format(i)): if name in self.psu_skip_list: self.expect(presence is False, "PSU {} in skip_modules inventory got presence True expected False".format(i)) else: self.expect(presence is True, "PSU {} is not present".format(i)) self.assert_expectations()