def setUp(self): super(SystemCollectionTestCase, self).setUp() self.conn = mock.Mock() with open('sushy/tests/unit/json_samples/' 'system_collection.json', 'r') as f: self.conn.get.return_value.json.return_value = json.loads(f.read()) self.sys_col = system.SystemCollection( self.conn, '/redfish/v1/Systems', redfish_version='1.0.2')
def get_system_collection(self): """Get the SystemCollection object :raises: MissingAttributeError, if the collection attribute is not found :returns: a SystemCollection object """ return system.SystemCollection(self._conn, self._systems_path, redfish_version=self.redfish_version)
def get_system_collection(self): """Get the SystemCollection object :raises: MissingAttributeError, if the collection attribute is not found :returns: a SystemCollection object """ if not self._systems_path: raise exceptions.MissingAttributeError( attribute='Systems/@odata.id', resource=self._path) return system.SystemCollection(self._conn, self._systems_path, redfish_version=self.redfish_version)