Esempio n. 1
0
 def setUp(self):
     super(ChassisCollectionTestCase, self).setUp()
     self.conn = mock.Mock()
     with open('sushy/tests/unit/json_samples/'
               'chassis_collection.json') as f:
         self.conn.get.return_value.json.return_value = json.load(f)
     self.chassis = chassis.ChassisCollection(
         self.conn, '/redfish/v1/Chassis', redfish_version='1.5.0')
Esempio n. 2
0
    def get_chassis_collection(self):
        """Get the ChassisCollection object

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

        return chassis.ChassisCollection(self._conn, self._chassis_path,
                                         redfish_version=self.redfish_version)