Commit f6e5e59
authored
Fix test_updater_thermal_check_min_max() (sonic-net#121)
Fixes the following crash introduced by sonic-net/sonic-platform-daemons#102:
```
01:33:00 ______________________ test_updater_thermal_check_min_max ______________________
01:33:00
01:33:00 def test_updater_thermal_check_min_max():
01:33:00 chassis = MockChassis()
01:33:00
01:33:00 thermal = MockThermal()
01:33:00 chassis.get_all_thermals().append(thermal)
01:33:00
01:33:00 chassis.set_modular_chassis(True)
01:33:00 chassis.set_my_slot(1)
01:33:00 temperature_updater = TemperatureUpdater(SYSLOG_IDENTIFIER, chassis)
01:33:00
01:33:00 temperature_updater.update()
01:33:00 slot_dict = temperature_updater.chassis_table.get('Thermal 1')
01:33:00 > assert slot_dict['minimum_temperature'] == str(thermal.get_minimum_recorded())
01:33:00 E TypeError: 'NoneType' object has no attribute '__getitem__'
01:33:00
01:33:00 tests/test_thermalctld.py:341: TypeError
```
Signed-off-by: Petro Bratash <petrox.bratash@intel.com>
Signed-off-by: Petro Bratash <petrox.bratash@intel.com>1 parent 14e586d commit f6e5e59
2 files changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
0 commit comments