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

Python tools.assert_response函数代码示例

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

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



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

示例1: test_index

def test_index():

    # test our first GET request to /game
    resp = app.request("/game")
    assert_response(resp)
    resp = app.request("/")
    assert_response(resp, status="303")
开发者ID:chmcphoy,项目名称:GothonWEB,代码行数:7,代码来源:app_tests.py


示例2: test_index

def test_index():

    # test our first GET request to /hello
    resp = app.request("/you_died")
    assert_response(resp)

    # make sure the default values work for the form
    resp = app.request("/show_room", method="POST")
    assert_response(resp, contains="Play Agains?")
开发者ID:kevinwu06,项目名称:lpthw,代码行数:9,代码来源:app_tests.py


示例3: test_family_member_submit

def test_family_member_submit():
	resp = app.request("/")
	assert_response(resp, contains="Rajesh Family Trust")
	resp = app.request("/family_members")
	assert_response(resp, contains="Family Members")
	resp = app.request("/family_member")
	assert_response(resp, contains="Family Member")
	resp = app.request("/family_member_edit")
	assert_response(resp, contains="Edit Family Member")
	resp = app.request("/family_member_submit", method="POST")
	assert_response(resp, status="303")
开发者ID:rajeshkurup,项目名称:PythonProjects,代码行数:11,代码来源:app_tests.py


示例4: test_Index

def test_Index():
    # check that we get a 404 on the / URL

    resp = app.request("/re")
    print "resp, index:", resp
    assert_response(resp, status="404")

    # test our first GET request to /hello
    resp = app.request("/")
    web.ctx.session.save()
    assert_response(resp, status="303")
开发者ID:26huitailang,项目名称:learn-python,代码行数:11,代码来源:app_tests.py


示例5: test_index

def test_index():
    # check that we get a 404 on the / URL
    resp = app.request("/")
    assert_response(resp, status="303")

    resp = app.request("/game", method="GET")

    # test that we get expected values
    data = {'action': 'dodge!'}
    resp = app.request("/game", method="POST", data=data)
    assert_response(resp, status="303")
开发者ID:G4l43r,项目名称:lpthw-cn,代码行数:11,代码来源:app_tests.py


示例6: test_GameEngine

def test_GameEngine():
    # make sure default values work for the form
    session = web.config._session
    # web.header('Set-Cookie', 'webpy_session_id=10a98447e9a79d19513226ea79aed7b2801ee6df; Path=/; httponly')
    resp = app.request(
        "/", method="GET"
    )  # , headers={'Ser-Cookie': 'webpy_session_id=10a98447e9a79d19513226ea79aed7b2801ee6df; Path=/; httponly'}
    assert_response(resp, contains="Central Corridor")

    # test that we get expected values
    data = {"name": "Zed", "greet": "Hola"}
    resp = app.request("/hello", method="POST", data=data)
    assert_response(resp, contains="Zeed")
开发者ID:26huitailang,项目名称:learn-python,代码行数:13,代码来源:app_tests.py


示例7: test_index

def test_index():
        # test our first GET request to /game
        resp = app.request("/game")
        assert_response(resp)
        resp = app.request("/")
        assert_response(resp, status="303")


        # make sure default values work for the form
        #resp = app.request("/hello", method="POST")
        #assert_response(resp, contains="Nobody")

        # test that we get expected values
        #data = {'name': 'Jay', 'greet': 'Hiya'}
        #resp = app.request("/hello", method="POST", data=data)
        #assert_response(resp, contains="Jay")
开发者ID:TheMyst,项目名称:IS-206,代码行数:16,代码来源:app_tests.py


示例8: test_family_member_edit

def test_family_member_edit():
	resp = app.request("/")
	assert_response(resp, contains="Rajesh Family Trust")
	resp = app.request("/family_members")
	assert_response(resp, contains="Family Members")
	resp = app.request("/family_member")
	assert_response(resp, contains="Family Member")
	resp = app.request("/family_member_edit")
	assert_response(resp, contains="Edit Family Member")
开发者ID:rajeshkurup,项目名称:PythonProjects,代码行数:9,代码来源:app_tests.py


示例9: test_index

def test_index():
    # check that we get a 404 on the / URL
    resp = app.request("/")
    assert_response(resp,status="404")
    
    #test our first GET request to /hello
    resp = app.request("/game")
    assert_response(resp)
    
    #make sure default values work for the form
    #resp = app.request("/game", method="POST")
    #assert_response(resp, action=None)
    
    # test that we get expected values
    #data = {'name':'Zed','greet':'Hola'}
    #resp = app.request("/hello", method="POST",data=data)
    #assert_response(resp,contains="Zed")
开发者ID:SophMC,项目名称:notechain,代码行数:17,代码来源:app_tests.py


示例10: test_index

def test_index():
	#check that we get a 404 on the /hello url
	resp = app.request("/aaa")
	assert_response(resp, status="404")

	#test first get request to /
	resp = app.request("/game")
	assert_response(resp)
	
	#make sure default values work for the form
	#resp = app.request("/game", method="POST")
	#assert_response(resp, contains="*") #this doesnt actually work
	
	#test that we get expected values
	#data = {'name': 'zed', 'greet': 'hola'}
	#resp = app.request("/", method="POST", data=data)
	#assert_response(resp, contains="Zed")
	pass	
开发者ID:jaybot7,项目名称:textvale,代码行数:18,代码来源:app_tests.py


示例11: test_index

def test_index():
	resp = app.request("/")
	assert_response(resp, status="404")
	
	resp = app.request("/index")
	assert_response(resp)
	
	resp = app.request("/index", method="POST")
	assert_response(resp, contains="Nobody")
	
	data = {'name':'Saisimon', 'greet': 'Hello'}
	resp = app.request("/index", method="POST", data=data)
	assert_response(resp, contains="Saisimon")
开发者ID:Saisimon,项目名称:tip,代码行数:13,代码来源:app_tests.py


示例12: test_index

def test_index():
	
	resp = app.request("/game")
	assert_response(resp)
	
	resp = app.request("/")
	assert_response(resp)
	
	resp = app.request("/lobby")
	assert_response(resp)
	
	resp = app.request("/help")
	assert_response(resp)
开发者ID:leokleist,项目名称:jungletemple,代码行数:13,代码来源:app_tests.py


示例13: test_index

def test_index():
  resp = app.request("/")
  assert_response(resp, status="404")

  resp = app.request("/hello")
  assert_response(resp)

  resp = app.request("/hello", method="POST")
  assert_response(resp, contains="Nobody")

  data = ['name': 'Zed', 'greet': 'Hola']
  resp = app.request("/hello", method="POST", data=data)
  assert_response(resp, contains="Zed")
开发者ID:HugoTamaki,项目名称:learning-python,代码行数:13,代码来源:app_tests.py


示例14: test_index

def test_index():
    # check that we get a 200 on the / URL
    resp = app.request("/")
    assert_response(resp, status="200")

    # check that we get a 404 on the / URL
    resp = app.request("/notexists")
    assert_response(resp, status="404")

    # test our first GET request to /hello
    resp = app.request("/hello")
    assert_response(resp)

    # make sure default values work for the form
    resp = app.request("/hello", method="POST")
    assert_response(resp, contains="Nobody")

    # test that we get expected values
    data = {'name': 'Zed', 'greet': 'Hola'}
    resp = app.request("/hello", method="POST", data=data)
    assert_response(resp, contains="Zed")
开发者ID:dennybiasiolli,项目名称:python_tutorial_2,代码行数:21,代码来源:app_tests.py


示例15: test_index

def test_index():
    # check that we get a 303 on the / URL
    resp = app.request("/")
    assert_response(resp, status="303")

    # test our first GET request to /game
    resp = app.request("/game")
    assert_response(resp)

    # test that we will die if we choose the wrong direction
    data = {'action': 'Shoot!'}
    resp = app.request("/game", method="POST", data=data)
    assert_response(resp, status="303")
    resp = app.request("/game")
    assert_response(resp, contains="You Died!")
开发者ID:renweizhukov,项目名称:LearningPythonTheHardWay,代码行数:15,代码来源:app_tests.py


示例16: test_index

def test_index():
	# check that we get a 404 on the / URL
	resp = app.request('/')
	assert_response(resp, status='404')

	# test our first GET request to /hello
	resp = app.request('/hello')
	assert_response(resp)

	# make sure default values work for the form
	resp = app.request('/hello', method='POST')
	assert_response(resp, contains="Nobody")

	data = {'name': 'Will', 'greet': 'Howdy'}
	resp = app.request('/hello', method='POST', data=data)
	assert_response(resp,contains='Will')
开发者ID:bearnax,项目名称:python_exercises,代码行数:16,代码来源:app_tests.py


示例17: test_index

def test_index():
    resp=app.request("/")
    assert_response(resp,status="303 See Other")

    resp=app.request("/game",method='POST')
    assert_response(resp,status="303")

    resp=app.request("/game",method='GET')
    assert_response(resp,status="200")
开发者ID:simonzss,项目名称:gothonweb,代码行数:9,代码来源:app_engine_tests.py


示例18: test_index

def test_index():
    # check for the 404 assert_response
    resp = app.request("/")
    assert_response(resp, status="404")

    # test first GET request to /hello
    resp = app.request("/hello")
    assert_response(resp)

    # check default values for the form
    resp = app.request('/hello', method="POST")
    assert_response(resp, contains="Nobody")

    # test that we get expected values
    data = {'name': "kron", 'greet':'hola'}
    resp = app.request('/hello', method="POST", data=data)
    assert_response(resp, contains='kron')
开发者ID:kstolzenberg,项目名称:LPTHW,代码行数:17,代码来源:app_tests.py


示例19: test_index

def test_index():
	# Check that we got a 404 in the / URL.
	resp = app.request("/")
	assert_response(resp, status="404")

	# Test our first GET request to /hello.
	resp = app.request("/hello")
	assert_response(resp)

	# Make sure that the default values work for the form.
	resp = app.request("/hello", method="POST")
	assert_response(resp, contains="Nobody")

	# Test that we get expected values.
	data = {'name': 'Zed', 'greet': 'Hola'}
	resp = app.request("/hello", method="POST", data=data)
	assert_response(resp, contains="Zed")
开发者ID:BryanSWong,项目名称:Python-1,代码行数:17,代码来源:app_tests.py


示例20: test_index

def test_index():
    #确认返回了 404 Not Found 相应
    resp = app.request("/")
    print assert_response(resp, status="404")

    #GET
    resp = app.request("/hello")
    assert_response(resp)
    # assert_response(resp, status="200")

    #POST
    resp = app.request("/hello", method="POST")
    assert_response(resp, contains="Nobody")

    data = {'name': "Zed", 'greet': 'Hola'}
    resp = app.request("/hello", method="POST", data=data)
    assert_response(resp, contains="Zed")
开发者ID:gitrobike,项目名称:gothonweb,代码行数:17,代码来源:app_tests.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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