Exemple #1
0
 def setUp(self):
     super(FabricCollectionTestCase, self).setUp()
     self.conn = mock.Mock()
     with open('sushy/tests/unit/json_samples/'
               'fabric_collection.json') as f:
         self.conn.get.return_value.json.return_value = json.load(f)
     self.fabric = fabric.FabricCollection(
         self.conn, '/redfish/v1/Fabrics', '1.0.3', None)
Exemple #2
0
    def get_fabric_collection(self):
        """Get the FabricCollection object

        :raises: MissingAttributeError, if the collection attribute is
            not found
        :returns: a FabricCollection object
        """
        if not self._fabrics_path:
            raise exceptions.MissingAttributeError(
                attribute='Fabrics/@odata.id', resource=self._path)

        return fabric.FabricCollection(self._conn, self._fabrics_path,
                                       redfish_version=self.redfish_version,
                                       registries=self.lazy_registries)