示例#1
0
 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)
示例#2
0
 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'
示例#3
0
 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)
示例#5
0
    def test_session_manager_deploy_negative_without_parameters(self):

        manager = sessions.SessionManager(api)

        self.assertRaises(TypeError, manager.deploy)
示例#6
0
    def test_session_manager_deploy_negative_with_one_parameter(self):

        manager = sessions.SessionManager(api)

        self.assertRaises(TypeError, manager.deploy, 'datacenter1')
示例#7
0
    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)
示例#8
0
    def test_session_manager_deploy(self):
        manager = sessions.SessionManager(api)
        result = manager.deploy('datacenter1', '1')

        self.assertIsNone(result)
示例#9
0
    def test_session_manager_configure_with_named_parameter(self):
        manager = sessions.SessionManager(api)
        result = manager.configure(environment_id='datacenter1')

        self.assertIsNotNone(result)
示例#10
0
    def test_session_manager_configure(self):
        manager = sessions.SessionManager(api)
        result = manager.configure('datacenter1')

        self.assertIsNotNone(result)
示例#11
0
 def test_session_manager_get(self):
     manager = sessions.SessionManager(api)
     result = manager.get('datacenter1', 'session1')
     # WTF?
     self.assertIsNotNone(result.manager)
示例#12
0
 def test_session_manager_configure(self):
     manager = sessions.SessionManager(api)
     result = manager.configure('datacenter1')
     assert result is not None
示例#13
0
 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
示例#14
0
 def test_session_manager_delete(self):
     manager = sessions.SessionManager(api)
     result = manager.delete('datacenter1', 'session1')
     assert result is None