Exemple #1
0
 def test_refresh_local(self):
     resource = BaseResource(
         None,
         'json_samples/message_registry.json',
         reader=resource_base.JsonPackagedFileReader('sushy.tests.unit'))
     self.assertIsNotNone(resource._json)
     self.assertEqual('Test.1.1.1', resource._json['Id'])
Exemple #2
0
    def _get_standard_message_registry_collection(self):
        """Load packaged standard message registries

        :returns: list of MessageRegistry
        """

        message_registries = []
        resource_package_name = __name__
        for json_file in pkg_resources.resource_listdir(
                resource_package_name, STANDARD_REGISTRY_PATH):
            # Not using path.join according to pkg_resources docs
            mes_reg = message_registry.MessageRegistry(
                None,
                STANDARD_REGISTRY_PATH + json_file,
                reader=base.JsonPackagedFileReader(resource_package_name))
            message_registries.append(mes_reg)

        return message_registries