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

Python utils.helper_test_http_method_and_count函数代码示例

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

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



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

示例1: test_storage_list

def test_storage_list(client, data):
    url = reverse("user-storage-list")

    users = [None, data.user1, data.user2]

    results = helper_test_http_method_and_count(client, "get", url, None, users)
    assert results == [(200, 0), (200, 1), (200, 2)]
开发者ID:Cyrilplus,项目名称:taiga-back,代码行数:7,代码来源:test_storage_resources.py


示例2: test_user_action_starred

def test_user_action_starred(client, data):
    url1 = reverse('users-starred', kwargs={"pk": data.project_member_without_perms.pk})
    url2 = reverse('users-starred', kwargs={"pk": data.project_member_with_perms.pk})
    url3 = reverse('users-starred', kwargs={"pk": data.project_owner.pk})

    users = [
        None,
        data.registered_user,
        data.project_member_without_perms,
        data.project_member_with_perms,
        data.project_owner
    ]

    results = helper_test_http_method_and_count(client, 'get', url1, None, users)
    assert results == [(200, 0), (200, 0), (200, 0), (200, 0), (200, 0)]
    results = helper_test_http_method_and_count(client, 'get', url2, None, users)
    assert results == [(200, 3), (200, 3), (200, 3), (200, 3), (200, 3)]
    results = helper_test_http_method_and_count(client, 'get', url3, None, users)
    assert results == [(200, 3), (200, 3), (200, 3), (200, 3), (200, 3)]
开发者ID:6ft,项目名称:taiga-back,代码行数:19,代码来源:test_projects_resource.py


示例3: test_project_action_fans

def test_project_action_fans(client, data):
    public_url = reverse('projects-fans', kwargs={"pk": data.public_project.pk})
    private1_url = reverse('projects-fans', kwargs={"pk": data.private_project1.pk})
    private2_url = reverse('projects-fans', kwargs={"pk": data.private_project2.pk})

    users = [
        None,
        data.registered_user,
        data.project_member_without_perms,
        data.project_member_with_perms,
        data.project_owner
    ]

    results = helper_test_http_method_and_count(client, 'get', public_url, None, users)
    assert results == [(200, 2), (200, 2), (200, 2), (200, 2), (200, 2)]
    results = helper_test_http_method_and_count(client, 'get', private1_url, None, users)
    assert results == [(200, 2), (200, 2), (200, 2), (200, 2), (200, 2)]
    results = helper_test_http_method_and_count(client, 'get', private2_url, None, users)
    assert results == [(404, 1), (404, 1), (404, 1), (200, 2), (200, 2)]
开发者ID:6ft,项目名称:taiga-back,代码行数:19,代码来源:test_projects_resource.py


示例4: test_project_watchers_list

def test_project_watchers_list(client, data):
    public_url = reverse('project-watchers-list', kwargs={"resource_id": data.public_project.pk})
    private1_url = reverse('project-watchers-list', kwargs={"resource_id": data.private_project1.pk})
    private2_url = reverse('project-watchers-list', kwargs={"resource_id": data.private_project2.pk})

    users = [
        None,
        data.registered_user,
        data.project_member_without_perms,
        data.project_member_with_perms,
        data.project_owner
    ]

    results = helper_test_http_method_and_count(client, 'get', public_url, None, users)
    assert results == [(200, 1), (200, 1), (200, 1), (200, 1), (200, 1)]
    results = helper_test_http_method_and_count(client, 'get', private1_url, None, users)
    assert results == [(200, 3), (200, 3), (200, 3), (200, 3), (200, 3)]
    results = helper_test_http_method_and_count(client, 'get', private2_url, None, users)
    assert results == [(401, 0), (403, 0), (403, 0), (200, 3), (200, 3)]
开发者ID:spetpet,项目名称:taiga-back,代码行数:19,代码来源:test_projects_resource.py


示例5: test_wiki_attachment_list

def test_wiki_attachment_list(client, data, data_wiki):
    url = reverse('wiki-attachments-list')

    users = [
        None,
        data.registered_user,
        data.project_member_without_perms,
        data.project_member_with_perms,
        data.project_owner
    ]

    results = helper_test_http_method_and_count(client, 'get', url, None, users)
    assert results == [(200, 2), (200, 2), (200, 2), (200, 4), (200, 4)]
开发者ID:ldf92,项目名称:taiga-back,代码行数:13,代码来源:test_attachment_resources.py


示例6: test_issue_attachment_list

def test_issue_attachment_list(client, data, data_issue):
    url = reverse("issue-attachments-list")

    users = [
        None,
        data.registered_user,
        data.project_member_without_perms,
        data.project_member_with_perms,
        data.project_owner,
    ]

    results = helper_test_http_method_and_count(client, "get", url, None, users)
    assert results == [(200, 2), (200, 2), (200, 2), (200, 4), (200, 4)]
开发者ID:adebayo-dealdey,项目名称:taiga-back,代码行数:13,代码来源:test_attachment_resources.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python utils.is_reachable函数代码示例发布时间:2022-05-27
下一篇:
Python utils.helper_test_http_method函数代码示例发布时间: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