本文整理汇总了Python中tests.tools.assert_response函数的典型用法代码示例。如果您正苦于以下问题:Python assert_response函数的具体用法?Python assert_response怎么用?Python assert_response使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assert_response函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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")
示例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?")
示例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")
示例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")
示例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")
示例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")
示例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")
示例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")
示例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")
示例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
示例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")
示例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)
示例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")
示例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")
示例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!")