Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix thermal api get_name test (#3579)
In the test when it‘s getting the thermal sensor name from platform.json, it's using an 'index' same as PSU and FAN. But thermal sensors are not like PSUs or FANs, when platform API init them, there could be no strict order, so use index may not be able to get the same sensor name every time. Suggest changing the way to collect all the sensors' names to a list and use "in" to judge whether the sensor name is in the list. What is the motivation for this PR? The test assuming thermal sensors have an index same as PSU and FAN, each time it's expecting use same index should get the same sensor, but this could be not true since thermal sensors don't have an index. How did you do it? Collect all the expected thermal sensor names to a list, and use 'in' to judge whether the sensor name get from "get_name" API are in the list. How did you verify/test it? run test: platform_tests/api/test_thermal.py::TestThermalApi::test_get_name
- Loading branch information