def bios(self): """Property to reference `Bios` instance It is set once when the first time it is queried. On refresh, this property is marked as stale (greedy-refresh not done). Here the actual refresh of the sub-resource happens, if stale. """ if self._bios is None: self._bios = bios.Bios(self._conn, utils.get_sub_resource_path_by( self, 'Bios'), redfish_version=self.redfish_version) self._bios.refresh(force=False) return self._bios
def setUp(self): super(BiosTestCase, self).setUp() self.conn = mock.Mock() with open('sushy/tests/unit/json_samples/bios.json') as f: bios_json = json.load(f) with open('sushy/tests/unit/json_samples/bios_settings.json') as f: bios_settings_json = json.load(f) self.conn.get.return_value.json.side_effect = [ bios_json, bios_settings_json, bios_settings_json ] self.sys_bios = bios.Bios(self.conn, '/redfish/v1/Systems/437XR1138R2/BIOS', redfish_version='1.0.2')
def setUp(self): super(BiosTestCase, self).setUp() self.conn = mock.Mock() with open('sushy/tests/unit/json_samples/bios.json') as f: self.bios_json = json.load(f) with open('sushy/tests/unit/json_samples/bios_settings.json') as f: self.bios_settings_json = json.load(f) self.conn.get.return_value.json.side_effect = [ self.bios_json, self.bios_settings_json, self.bios_settings_json ] conn = mock.Mock() with open('sushy/tests/unit/json_samples/message_registry.json') as f: conn.get.return_value.json.return_value = json.load(f) registry = message_registry.MessageRegistry( conn, '/redfish/v1/Registries/Test', redfish_version='1.0.2') self.sys_bios = bios.Bios(self.conn, '/redfish/v1/Systems/437XR1138R2/BIOS', registries={'Test.1.0': registry}, redfish_version='1.0.2')