def setUp(self): super(ManagerCollectionTestCase, self).setUp() self.conn = mock.Mock() with open('sushy/tests/unit/json_samples/' 'manager_collection.json') as f: self.conn.get.return_value.json.return_value = json.load(f) self.managers = manager.ManagerCollection( self.conn, '/redfish/v1/Managers', redfish_version='1.0.2')
def get_manager_collection(self): """Get the ManagerCollection object :raises: MissingAttributeError, if the collection attribute is not found :returns: a ManagerCollection object """ return manager.ManagerCollection(self._conn, self._managers_path, redfish_version=self.redfish_version)
def get_manager_collection(self): """Get the ManagerCollection object :raises: MissingAttributeError, if the collection attribute is not found :returns: a ManagerCollection object """ if not self._managers_path: raise exceptions.MissingAttributeError( attribute='Managers/@odata.id', resource=self._path) return manager.ManagerCollection(self._conn, self._managers_path, redfish_version=self.redfish_version)