def __init__(self, *args, **kwargs): """Initialize a new client for the Murano v1 API.""" self.glance_client = kwargs.pop('glance_client', None) tenant = kwargs.pop('tenant', None) self.http_client = http._construct_http_client(*args, **kwargs) self.environments = environments.EnvironmentManager(self.http_client) self.env_templates = templates.EnvTemplateManager(self.http_client) self.sessions = sessions.SessionManager(self.http_client) self.services = services.ServiceManager(self.http_client) self.deployments = deployments.DeploymentManager(self.http_client) self.request_statistics = \ request_statistics.RequestStatisticsManager(self.http_client) self.instance_statistics = \ instance_statistics.InstanceStatisticsManager(self.http_client) artifacts_client = kwargs.pop('artifacts_client', None) pkg_mgr = packages.PackageManager(self.http_client) if artifacts_client: artifact_repo = artifact_packages.ArtifactRepo( artifacts_client, tenant) self.packages = artifact_packages.PackageManagerAdapter( pkg_mgr, artifact_repo) else: self.packages = pkg_mgr self.actions = actions.ActionManager(self.http_client) self.categories = categories.CategoryManager(self.http_client)
def test_session_manager_deploy_negative_without_parameters(self): result = 'Exception' manager = sessions.SessionManager(api) try: result = manager.deploy() except TypeError: pass assert result == 'Exception'
def test_session_manager_delete_negative_with_one_parameter(self): result = 'Exception' manager = sessions.SessionManager(api) try: result = manager.delete('datacenter1') except TypeError: pass assert result == 'Exception'
def __init__(self, *args, **kwargs): """ Initialize a new client for the Murano v1 API. """ super(Client, self).__init__(*args, **kwargs) self.environments = environments.EnvironmentManager(self) self.sessions = sessions.SessionManager(self) self.services = services.ServiceManager(self) self.deployments = deployments.DeploymentManager(self) self.request_statistics = \ request_statistics.RequestStatisticsManager(self) self.instance_statistics = \ instance_statistics.InstanceStatisticsManager(self) self.packages = packages.PackageManager(self)
def test_session_manager_deploy_negative_without_parameters(self): manager = sessions.SessionManager(api) self.assertRaises(TypeError, manager.deploy)
def test_session_manager_deploy_negative_with_one_parameter(self): manager = sessions.SessionManager(api) self.assertRaises(TypeError, manager.deploy, 'datacenter1')
def test_session_manager_deploy_with_named_parameters(self): manager = sessions.SessionManager(api) result = manager.deploy(environment_id='datacenter1', session_id='1') self.assertIsNone(result)
def test_session_manager_deploy(self): manager = sessions.SessionManager(api) result = manager.deploy('datacenter1', '1') self.assertIsNone(result)
def test_session_manager_configure_with_named_parameter(self): manager = sessions.SessionManager(api) result = manager.configure(environment_id='datacenter1') self.assertIsNotNone(result)
def test_session_manager_configure(self): manager = sessions.SessionManager(api) result = manager.configure('datacenter1') self.assertIsNotNone(result)
def test_session_manager_get(self): manager = sessions.SessionManager(api) result = manager.get('datacenter1', 'session1') # WTF? self.assertIsNotNone(result.manager)
def test_session_manager_configure(self): manager = sessions.SessionManager(api) result = manager.configure('datacenter1') assert result is not None
def test_session_manager_delete_with_named_parameters(self): manager = sessions.SessionManager(api) result = manager.delete(environment_id='datacenter1', session_id='session1') assert result is None
def test_session_manager_delete(self): manager = sessions.SessionManager(api) result = manager.delete('datacenter1', 'session1') assert result is None