def test_auto_update_firmware_default(monkeypatch, update_func, notify, image_found, boot_type, expect): def mock_path_exists(path): return image_found test_component_ssd = ComponentSSD() monkeypatch.setattr(test_component_ssd, 'update_firmware', update_func) monkeypatch.setattr(test_component_ssd, 'get_firmware_update_notification', notify) monkeypatch.setattr(os.path, 'exists', mock_path_exists) result = test_component_ssd.auto_update_firmware(None, boot_type) assert result == expect
def initialize_components(self): # Initialize component list from sonic_platform.component import ComponentONIE, ComponentSSD, ComponentBIOS, ComponentCPLD self._component_list.append(ComponentONIE()) self._component_list.append(ComponentSSD()) self._component_list.append(ComponentBIOS()) self._component_list.extend(ComponentCPLD.get_component_list())