当前位置: 首页>>代码示例>>Python>>正文


Python FakeArgs.quiet方法代码示例

本文整理汇总了Python中helpers.FakeArgs.quiet方法的典型用法代码示例。如果您正苦于以下问题:Python FakeArgs.quiet方法的具体用法?Python FakeArgs.quiet怎么用?Python FakeArgs.quiet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在helpers.FakeArgs的用法示例。


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

示例1: test_swagger_target

# 需要导入模块: from helpers import FakeArgs [as 别名]
# 或者: from helpers.FakeArgs import quiet [as 别名]
 def test_swagger_target(self):
     """
     [XOS-GenX] The swagger xtarget should generate the appropriate json
     """
     # xosgenx --output . --target xosgenx/targets/swagger.xtarget --write-to-file single  --dest-file swagger.yaml ../../xos/core/models/core.xproto
     # http-server --cors Users/teone/Sites/opencord/orchestration/xos/lib/xos-genx/
     xproto = \
         """
         option app_label = "core";
 
         message Instance::instance_policy (XOSBase) {
              option validators = "instance_creator:Instance has no creator, instance_isolation: Container instance {obj.name} must use container image, instance_isolation_container_vm_parent:Container-vm instance {obj.name} must have a parent, instance_parent_isolation_container_vm:Parent field can only be set on Container-vm instances ({obj.name}), instance_isolation_vm: VM Instance {obj.name} must use VM image, instance_creator_privilege: instance creator has no privileges on slice";
              optional string instance_id = 1 [max_length = 200, content_type = "stripped", blank = True, help_text = "Nova instance id", null = True, db_index = False];
              optional string instance_uuid = 2 [max_length = 200, content_type = "stripped", blank = True, help_text = "Nova instance uuid", null = True, db_index = False];
              required string name = 3 [max_length = 200, content_type = "stripped", blank = False, help_text = "Instance name", null = False, db_index = False];
              optional string instance_name = 4 [max_length = 200, content_type = "stripped", blank = True, help_text = "OpenStack generated name", null = True, db_index = False];
              optional string ip = 5 [max_length = 39, content_type = "ip", blank = True, help_text = "Instance ip address", null = True, db_index = False, gui_hidden = True];
              required manytoone image->Image:instances = 6 [db_index = True, null = False, blank = False];
              optional manytoone creator->User:instances = 7 [db_index = True, null = True, blank = True];
              required manytoone slice->Slice:instances = 8 [db_index = True, null = False, blank = False];
              required manytoone deployment->Deployment:instance_deployment = 9 [db_index = True, null = False, blank = False];
              required manytoone node->Node:instances = 10 [db_index = True, null = False, blank = False];
              required int32 numberCores = 11 [help_text = "Number of cores for instance", default = 0, null = False, db_index = False, blank = False];
              required manytoone flavor->Flavor:instance = 12 [help_text = "Flavor of this instance", null = False, db_index = True, blank = False];
              optional string userData = 13 [help_text = "user_data passed to instance during creation", null = True, db_index = False, blank = True, varchar = True];
              required string isolation = 14 [default = "vm", choices = "(('vm', 'Virtual Machine'), ('container', 'Container'), ('container_vm', 'Container In VM'))", max_length = 30, blank = False, null = False, db_index = False];
              optional string volumes = 15 [help_text = "Comma-separated list of directories to expose to parent context", null = True, db_index = False, blank = True];
              optional manytoone parent->Instance:instance = 16 [help_text = "Parent Instance for containers nested inside of VMs", null = True, db_index = True, blank = True];
         }
         """
     args = FakeArgs()
     args.inputs = xproto
     args.target = 'swagger.xtarget'
     args.output = "/Users/teone/Sites/opencord/orchestration/xos/lib/xos-genx"
     args.write_to_file = "single"
     args.dest_file = "swagger.yaml"
     args.quiet = False
     output = XOSGenerator.generate(args)
     self.assertEqual(True, False);
开发者ID:vpramo,项目名称:xos-1,代码行数:41,代码来源:swagger_test.py


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