• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.generate_name函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中murano_tempest_tests.utils.generate_name函数的典型用法代码示例。如果您正苦于以下问题:Python generate_name函数的具体用法?Python generate_name怎么用?Python generate_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了generate_name函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: resource_setup

 def resource_setup(cls):
     super(TestCategories, cls).resource_setup()
     application_name = utils.generate_name(cls.__name__)
     cls.abs_archive_path, dir_with_archive, archive_name = \
         utils.prepare_package(application_name)
     cls.package = cls.application_catalog_client.upload_package(
         application_name, archive_name, dir_with_archive,
         {"categories": [], "tags": [], 'is_public': False})
     name = utils.generate_name(cls.__name__)
     cls.category = cls.application_catalog_client.create_category(name)
开发者ID:AleptNamrata,项目名称:murano,代码行数:10,代码来源:test_categories.py


示例2: test_get_public_private_both_env_templates

    def test_get_public_private_both_env_templates(self):
        name = utils.generate_name('get_public_private_both')
        public_env_template = self.application_catalog_client.\
            create_public_env_template(name)
        self.addCleanup(self.application_catalog_client.delete_env_template,
                        public_env_template['id'])
        self.assertTrue(public_env_template['is_public'])
        private_name = utils.generate_name('get_public_private_both')
        private_env_template = self.application_catalog_client.\
            create_env_template(private_name)
        self.addCleanup(self.application_catalog_client.delete_env_template,
                        private_env_template['id'])
        self.assertFalse(private_env_template['is_public'])
        private_name_alt = utils.generate_name('get_public_private_both')
        private_alt_env_template = self.alt_client.\
            create_env_template(private_name_alt)
        self.addCleanup(self.alt_client.delete_env_template,
                        private_alt_env_template['id'])

        public_env_templates = self.application_catalog_client.\
            get_public_env_templates_list()
        self.assertIn(public_env_template, public_env_templates)
        self.assertNotIn(private_env_template, public_env_templates)
        self.assertNotIn(private_alt_env_template, public_env_templates)

        private_env_templates = self.application_catalog_client.\
            get_private_env_templates_list()
        self.assertNotIn(public_env_template, private_env_templates)
        self.assertIn(private_env_template, private_env_templates)
        self.assertNotIn(private_alt_env_template, private_env_templates)

        env_templates = self.application_catalog_client.\
            get_env_templates_list()
        self.assertIn(public_env_template, env_templates)
        self.assertIn(private_env_template, env_templates)
        self.assertNotIn(private_alt_env_template, env_templates)

        alt_pub_templates = self.alt_client.get_public_env_templates_list()
        self.assertIn(public_env_template, alt_pub_templates)
        self.assertNotIn(private_env_template, alt_pub_templates)
        self.assertNotIn(private_alt_env_template, alt_pub_templates)

        alt_priv_templates = self.alt_client.get_private_env_templates_list()
        self.assertNotIn(public_env_template, alt_priv_templates)
        self.assertNotIn(private_env_template, alt_priv_templates)
        self.assertIn(private_alt_env_template, alt_priv_templates)

        alt_env_templates = self.alt_client.get_env_templates_list()
        self.assertIn(public_env_template, alt_env_templates)
        self.assertNotIn(private_env_template, alt_env_templates)
        self.assertIn(private_alt_env_template, alt_env_templates)
开发者ID:AleptNamrata,项目名称:murano,代码行数:51,代码来源:test_env_templates.py


示例3: test_create_env_from_template

 def test_create_env_from_template(self):
     name = utils.generate_name("create_env_from_template")
     env_template = self.application_catalog_client.create_public_env_template(name)
     self.addCleanup(self.application_catalog_client.delete_env_template, env_template["id"])
     post_body = self._get_demo_app()
     service = self.application_catalog_client.create_service_in_env_template(env_template["id"], post_body)
     self.assertEqual(post_body["name"], service["name"])
     env_name = utils.generate_name("create_env_from_template")
     environment = self.application_catalog_client.create_env_from_template(env_template["id"], env_name)
     self.addCleanup(self.application_catalog_client.delete_environment, environment["environment_id"])
     self.assertIsNotNone(environment)
     service_from_env = self.application_catalog_client.get_service(
         environment["environment_id"], service["?"]["id"], environment["session_id"]
     )
     self.assertEqual(service, service_from_env)
开发者ID:NeCTAR-RC,项目名称:murano,代码行数:15,代码来源:test_env_templates.py


示例4: test_binding_instance

 def test_binding_instance(self):
     application_name = utils.generate_name('cfapi')
     abs_archive_path, dir_with_archive, archive_name = \
         utils.prepare_package(application_name)
     self.addCleanup(os.remove, abs_archive_path)
     package = self.application_catalog_client.upload_package(
         application_name, archive_name, dir_with_archive,
         {"categories": [], "tags": [], 'is_public': True})
     self.addCleanup(self.application_catalog_client.delete_package,
                     package['id'])
     app_list = self.service_broker_client.get_applications_list()
     app = self.service_broker_client.get_application(application_name,
                                                      app_list)
     post_json = {}
     instance_id = utils.generate_uuid()
     space_id = utils.generate_uuid()
     service = self.service_broker_client.provision(
         instance_id, app['id'], app['plans'][0]['id'],
         space_id, post_json)
     self.wait_for_result(instance_id, 30)
     self.addCleanup(self.perform_deprovision, instance_id)
     self.assertIsInstance(json.loads(service), dict)
     binding = self.service_broker_client.create_binding(instance_id)
     self.assertIsInstance(binding, dict)
     self.assertEqual({'uri': 'localhost'}, binding)
开发者ID:Aqsamm,项目名称:murano,代码行数:25,代码来源:test_service_broker_actions.py


示例5: test_create_public_env_template

 def test_create_public_env_template(self):
     name = utils.generate_name("create_public_env_template")
     env_template = self.application_catalog_client.create_public_env_template(name)
     self.addCleanup(self.application_catalog_client.delete_env_template, env_template["id"])
     self.assertEqual(name, env_template["name"])
     env_temp = self.application_catalog_client.get_env_template(env_template["id"])
     self.assertTrue(env_temp["is_public"])
开发者ID:NeCTAR-RC,项目名称:murano,代码行数:7,代码来源:test_env_templates.py


示例6: test_provision_with_incorrect_input

    def test_provision_with_incorrect_input(self):
        """Test provision with restricted items in object model

        Test will fail on deprovision, if parameters from '?' section
        will passed through service-broker.
        """
        application_name = utils.generate_name('cfapi')
        abs_archive_path, dir_with_archive, archive_name = \
            utils.prepare_package(application_name)
        self.addCleanup(os.remove, abs_archive_path)
        package = self.application_catalog_client.upload_package(
            application_name, archive_name, dir_with_archive,
            {"categories": [], "tags": [], 'is_public': True})
        self.addCleanup(self.application_catalog_client.delete_package,
                        package['id'])
        app_list = self.service_broker_client.get_applications_list()
        app = self.service_broker_client.get_application(application_name,
                                                         app_list)

        # NOTE(freerunner): The '?' section should be cutted off during
        # provision action.
        post_json = {
            '?': {
                'type': 'io.murano.apps.{0}'.format(application_name),
                'id': utils.generate_uuid()
            }
        }
        instance_id = utils.generate_uuid()
        space_id = utils.generate_uuid()
        service = self.service_broker_client.provision(
            instance_id, app['id'], app['plans'][0]['id'],
            space_id, post_json)
        self.wait_for_result(instance_id, 30)
        self.addCleanup(self.perform_deprovision, instance_id)
        self.assertIsInstance(json.loads(service), dict)
开发者ID:Aqsamm,项目名称:murano,代码行数:35,代码来源:test_service_broker_actions.py


示例7: test_clone_env_template

 def test_clone_env_template(self):
     name = utils.generate_name("clone_env_template")
     cloned_template = self.alt_client.clone_env_template(self.env_template["id"], name)
     self.addCleanup(self.alt_client.delete_env_template, cloned_template["id"])
     self.assertEqual(name, cloned_template["name"])
     template = self.alt_client.get_env_template(cloned_template["id"])
     self.assertEqual(name, template["name"])
开发者ID:NeCTAR-RC,项目名称:murano,代码行数:7,代码来源:test_env_templates.py


示例8: update_environment

 def update_environment(self, environment_id):
     uri = 'v1/environments/{0}'.format(environment_id)
     name = utils.generate_name("updated_env")
     post_body = {"name": name}
     resp, body = self.put(uri, json.dumps(post_body))
     self.expected_success(200, resp.status)
     return self._parse_resp(body)
开发者ID:AleptNamrata,项目名称:murano,代码行数:7,代码来源:application_catalog_client.py


示例9: resource_setup

 def resource_setup(cls):
     super(TestServicesNegativeTenantIsolation, cls).resource_setup()
     name = utils.generate_name(cls.__name__)
     cls.environment = cls.application_catalog_client.\
         create_environment(name)
     cls.alt_client = cls.get_client_with_isolated_creds(
         type_of_creds='alt')
开发者ID:Aqsamm,项目名称:murano,代码行数:7,代码来源:test_services_negative.py


示例10: resource_setup

 def resource_setup(cls):
     super(TestEnvironmentTemplatesNegative, cls).resource_setup()
     cls.name = utils.generate_name(cls.__name__)
     cls.env_template = cls.application_catalog_client.\
         create_env_template(cls.name)
     cls.environment = cls.application_catalog_client.\
         create_environment(cls.name)
     cls.alt_client = cls.get_client_with_isolated_creds('alt')
开发者ID:olivierlemasle,项目名称:murano,代码行数:8,代码来源:test_env_templates_negative.py


示例11: test_get_deleted_environment

 def test_get_deleted_environment(self):
     name = utils.generate_name('double_del_negavive')
     environment = self.application_catalog_client.\
         create_environment(name)
     self.application_catalog_client.delete_environment(environment['id'])
     self.assertRaises(exceptions.NotFound,
                       self.application_catalog_client.get_environment,
                       environment['id'])
开发者ID:AleptNamrata,项目名称:murano,代码行数:8,代码来源:test_environments_negative.py


示例12: test_create_env_template_with_a_service

 def test_create_env_template_with_a_service(self):
     name = utils.generate_name("create_env_template_with_service")
     post_body = self._get_demo_app()
     env_template = self.application_catalog_client.create_env_template_with_services(name, post_body)
     self.addCleanup(self.application_catalog_client.delete_env_template, env_template["id"])
     list_services = self.application_catalog_client.get_services_list_in_env_template(env_template["id"])
     self.assertIsInstance(list_services, list)
     self.assertIn(post_body, list_services)
开发者ID:NeCTAR-RC,项目名称:murano,代码行数:8,代码来源:test_env_templates.py


示例13: test_get_deleted_env_template

 def test_get_deleted_env_template(self):
     name = utils.generate_name('get_deleted_env_template')
     env_template = self.application_catalog_client.\
         create_env_template(name)
     self.application_catalog_client.delete_env_template(
         env_template['id'])
     self.assertRaises(exceptions.NotFound,
                       self.application_catalog_client.get_env_template,
                       env_template['id'])
开发者ID:olivierlemasle,项目名称:murano,代码行数:9,代码来源:test_env_templates_negative.py


示例14: test_get_session_after_delete_env

 def test_get_session_after_delete_env(self):
     name = utils.generate_name('get_session_after_delete_env')
     environment = self.application_catalog_client.create_environment(name)
     session = self.application_catalog_client.\
         create_session(environment['id'])
     self.application_catalog_client.delete_environment(environment['id'])
     self.assertRaises(exceptions.NotFound,
                       self.application_catalog_client.get_session,
                       environment['id'], session['id'])
开发者ID:olivierlemasle,项目名称:murano,代码行数:9,代码来源:test_sessions_negative.py


示例15: resource_setup

    def resource_setup(cls):
        super(TestRepository, cls).resource_setup()

        application_name = utils.generate_name('test_repository_class')
        cls.abs_archive_path, dir_with_archive, archive_name = \
            utils.prepare_package(application_name)
        cls.package = cls.application_catalog_client.upload_package(
            application_name, archive_name, dir_with_archive,
            {"categories": [], "tags": [], 'is_public': False})
开发者ID:Magic-Mirror,项目名称:murano,代码行数:9,代码来源:test_repository.py


示例16: test_clone_env_template

 def test_clone_env_template(self):
     name = utils.generate_name('clone_env_template')
     cloned_template = self.alt_client.\
         clone_env_template(self.env_template['id'], name)
     self.addCleanup(self.alt_client.delete_env_template,
                     cloned_template['id'])
     self.assertEqual(name, cloned_template['name'])
     template = self.alt_client.get_env_template(cloned_template['id'])
     self.assertEqual(name, template['name'])
开发者ID:AleptNamrata,项目名称:murano,代码行数:9,代码来源:test_env_templates.py


示例17: test_create_public_env_template

 def test_create_public_env_template(self):
     name = utils.generate_name('create_public_env_template')
     env_template = self.application_catalog_client.\
         create_public_env_template(name)
     self.addCleanup(self.application_catalog_client.delete_env_template,
                     env_template['id'])
     self.assertEqual(name, env_template['name'])
     env_temp = self.application_catalog_client.\
         get_env_template(env_template['id'])
     self.assertTrue(env_temp['is_public'])
开发者ID:AleptNamrata,项目名称:murano,代码行数:10,代码来源:test_env_templates.py


示例18: test_create_and_delete_env_template

 def test_create_and_delete_env_template(self):
     name = utils.generate_name("create_and_delete_env_template")
     env_template = self.application_catalog_client.create_env_template(name)
     self.assertFalse(env_template["is_public"])
     self.assertEqual(name, env_template["name"])
     env_templates_list = self.application_catalog_client.get_env_templates_list()
     self.assertIn(env_template, env_templates_list)
     self.application_catalog_client.delete_env_template(env_template["id"])
     env_templates_list = self.application_catalog_client.get_env_templates_list()
     self.assertNotIn(env_template, env_templates_list)
开发者ID:NeCTAR-RC,项目名称:murano,代码行数:10,代码来源:test_env_templates.py


示例19: resource_setup

    def resource_setup(cls):
        super(TestRepositoryNegativeForbidden, cls).resource_setup()

        application_name = utils.generate_name('package_test_upload')
        cls.abs_archive_path, dir_with_archive, archive_name = \
            utils.prepare_package(application_name)
        cls.package = cls.application_catalog_client.upload_package(
            application_name, archive_name, dir_with_archive,
            {"categories": [], "tags": [], 'is_public': False})
        cls.alt_client = cls.get_client_with_isolated_creds(
            type_of_creds='alt')
开发者ID:olivierlemasle,项目名称:murano,代码行数:11,代码来源:test_repository_negative.py


示例20: test_create_and_delete_category

 def test_create_and_delete_category(self):
     name = utils.generate_name('create_and_delete_category')
     categories_list = self.application_catalog_client.list_categories()
     self.assertNotIn(name, categories_list)
     category = self.application_catalog_client.create_category(name)
     self.assertEqual(name, category['name'])
     categories_list = self.application_catalog_client.list_categories()
     self.assertIn(name, categories_list)
     self.application_catalog_client.delete_category(category['id'])
     categories_list = self.application_catalog_client.list_categories()
     self.assertNotIn(name, categories_list)
开发者ID:AleptNamrata,项目名称:murano,代码行数:11,代码来源:test_categories.py



注:本文中的murano_tempest_tests.utils.generate_name函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python gettextutils._函数代码示例发布时间:2022-05-27
下一篇:
Python utils.save_models函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap