def test_loader_retrieve_provider(self): providers = ["juju.providers.dummy.MachineProvider", "juju.providers.ec2.MachineProvider"] for provider_name in providers: provider = get_callable(provider_name) self.assertEqual(provider.__name__, "MachineProvider") self.assertTrue(callable(provider))
def test_loader_retrieve_provider(self): providers = [ "juju.providers.dummy.MachineProvider", "juju.providers.ec2.MachineProvider" ] for provider_name in providers: provider = get_callable(provider_name) self.assertEqual(provider.__name__, "MachineProvider") self.assertTrue(callable(provider))
def get_machine_provider(self): """Return a MachineProvider instance for the given provider name. The returned instance will be retrieved from the module named after the type of the given machine provider. """ if self._machine_provider is None: provider_type = self._environment_config["type"] MachineProvider = get_callable( "juju.providers.%s.MachineProvider" % provider_type) self._machine_provider = MachineProvider( self._name, self._environment_config) return self._machine_provider
def get_machine_provider(self): """Return a MachineProvider instance for the given provider name. The returned instance will be retrieved from the module named after the type of the given machine provider. """ if self._machine_provider is None: provider_type = self._environment_config["type"] MachineProvider = get_callable( "juju.providers.%s.MachineProvider" % provider_type) self._machine_provider = MachineProvider(self._name, self._environment_config) return self._machine_provider
def test_loader_valid_specification(self): split = get_callable("os.path.split") assert callable(split) assert split("foo/bar") == ("foo", "bar")