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


Python Request.description方法代码示例

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


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

示例1: test_request19

# 需要导入模块: from osc2.remote import Request [as 别名]
# 或者: from osc2.remote.Request import description [as 别名]
 def test_request19(self):
     """create a request (test None attrib filter in class ElementFactory"""
     # nearly identical to test_request2 (except the None's here and there)
     req = Request()
     action = req.add_action(type='submit', xyz=None)
     action.add_source(project='foo', package='bar', rev='12345')
     action.add_target(project='foobar', package=None)
     options = action.add_options()
     options.add_sourceupdate('cleanup', attr=None)
     req.description = 'some description'
     req.store()
     self.assertEqual(req.get('id'), '42')
     self.assertTrue(len(req.action) == 1)
     self.assertEqual(req.action[0].get('type'), 'submit')
     self.assertEqual(req.action[0].source.get('project'), 'foo')
     self.assertEqual(req.action[0].source.get('package'), 'bar')
     self.assertEqual(req.action[0].source.get('rev'), '12345')
     self.assertEqual(req.action[0].target.get('project'), 'foobar')
     self.assertIsNone(req.action[0].target.get('package'))
     self.assertEqual(req.action[0].options.sourceupdate, 'cleanup')
     self.assertIsNone(req.action[0].options.sourceupdate.get('attr'))
     self.assertEqual(req.state.get('name'), 'new')
     self.assertEqual(req.state.get('who'), 'username')
     self.assertEqual(req.state.get('when'), '2011-06-10T14:33:55')
     self.assertEqual(req.description, 'some description')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:27,代码来源:test_remote.py

示例2: create

# 需要导入模块: from osc2.remote import Request [as 别名]
# 或者: from osc2.remote.Request import description [as 别名]
 def create(cls, renderer, submit, changedevel, role, grouprole, delete,
            info):
     """Creates a new request."""
     global SHOW_TEMPLATE
     request = Request()
     message = info.message
     if message is None:
         message = edit_message()
     cls._create_submit_actions(request, submit)
     cls._create_changedevel_actions(request, changedevel)
     cls._create_role_actions(request, role)
     cls._create_grouprole_actions(request, grouprole)
     cls._create_delete_actions(request, delete)
     request.description = message
     request.store()
     renderer.render(SHOW_TEMPLATE, request=request)
开发者ID:bergmannf,项目名称:osc2,代码行数:18,代码来源:request.py

示例3: test_request2

# 需要导入模块: from osc2.remote import Request [as 别名]
# 或者: from osc2.remote.Request import description [as 别名]
 def test_request2(self):
     """create a request"""
     req = Request()
     action = req.add_action(type='submit')
     action.add_source(project='foo', package='bar', rev='12345')
     action.add_target(project='foobar')
     options = action.add_options()
     options.add_sourceupdate('cleanup')
     req.description = 'some description'
     req.store()
     self.assertEqual(req.get('id'), '42')
     self.assertTrue(len(req.action) == 1)
     self.assertEqual(req.action[0].get('type'), 'submit')
     self.assertEqual(req.action[0].source.get('project'), 'foo')
     self.assertEqual(req.action[0].source.get('package'), 'bar')
     self.assertEqual(req.action[0].source.get('rev'), '12345')
     self.assertEqual(req.action[0].target.get('project'), 'foobar')
     self.assertEqual(req.action[0].options.sourceupdate, 'cleanup')
     self.assertEqual(req.state.get('name'), 'new')
     self.assertEqual(req.state.get('who'), 'username')
     self.assertEqual(req.state.get('when'), '2011-06-10T14:33:55')
     self.assertEqual(req.description, 'some description')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:24,代码来源:test_remote.py


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