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


Python Rally.deleteAttachment方法代码示例

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


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

示例1: x_test_detach_attachment

# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import deleteAttachment [as 别名]
def x_test_detach_attachment():
    """
    """
    rally = Rally(server=TRIAL, user=TRIAL_USER, password=TRIAL_PSWD)
    candidate_story = "S78"
    target = 'FormattedID = "%s"' % candidate_story

    response = rally.get("UserStory", fetch=True, query=target, project=None)
    assert response.resultCount == 1
    story = response.next()
    assert len(story.Attachments) == 1
    attachment = story.Attachments[0]
    expected_attachment_name = "Addendum.txt"
    assert attachment.Name == expected_attachment_name

    result = rally.deleteAttachment(story, expected_attachment_name)
    assert result != False
    assert len(result.Attachments) == (len(story.Attachments) - 1)
开发者ID:bimsapi,项目名称:RallyRestToolkitForPython,代码行数:20,代码来源:test_attachments.py

示例2: test_detach_attachment

# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import deleteAttachment [as 别名]
def test_detach_attachment():
    """
        This is the counterpart test for test_add_attachment
    """
    rally = Rally(server=AGICEN, user=AGICEN_USER, password=AGICEN_PSWD)
    candidate_story = "US1"   # "US96"
    target = 'FormattedID = "%s"' % candidate_story

    response = rally.get("UserStory", fetch=True, query=target, project=None)
    assert response.resultCount == 1
    story = response.next()
    assert len(story.Attachments) == 1
    attachment = story.Attachments[0]
    expected_attachment_name = "Addendum.txt"
    assert attachment.Name == expected_attachment_name

    result = rally.deleteAttachment(story, expected_attachment_name)
    assert result != False
    assert len(result.Attachments) == (len(story.Attachments) - 1)
开发者ID:amcolosk,项目名称:RallyRestToolkitForPython,代码行数:21,代码来源:test_attachments.py


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