示例#1
0
 def _(_):
     res = testApp.get('/page_with_params_dictionary_as_input?a=A&b=B')
     expect(res.status) == 200
     expect(res.body) != b'{}'
示例#2
0
 def _(_):
     res = testApp.get('/page_with_parameters?a=A&a=AA')
     expect(res.status) == 200
     expect(res.body) == b"['A', 'AA']"
示例#3
0
 def _(_):
     res = testApp.get('/page_without_params?a=A')
     expect(res.status) == 200
     expect(res.body) == b''
示例#4
0
 def _(self):
     res = testApp.get('/missing/page?param=1&param=2')
     expect(res.status) == 200
     expect(res.body) == b'Missing Page: /missing/page'
示例#5
0
 def _(_):
     expect(parseQuery("?a"))  == web.Storage(a=True)
示例#6
0
 def _(self):
     res = testApp.get('/missingpage')
     expect(res.status) == 200
     expect(res.body) == b'SiteRoot.default'
示例#7
0
 def _(self):
     res = testApp.get('/')
     expect(res.status) == 200
     expect(res.body) == b'Missing Page: /'
示例#8
0
 def _(_):
     def caller():
         res = testApp.post('/assert_post_request')
     
     expect(caller).not_raise()
示例#9
0
 def _(self):
     res = testApp.get('/noIndexWithDefault')
     expect(res.status) == 200
     expect(res.body) == b'SecondLevelNoIndexWithDefault.default'
示例#10
0
 def _(_):
     expect(True) == False 
示例#11
0
 def _(self):
     res = testApp.get('/withDefault/missingpage/third')
     expect(res.status) == 200
     expect(res.body) == b'SecondLevelWithDefault.default'
示例#12
0
 def _(self):
     res = testApp.get('/withDefault/notexposed')
     expect(res.status) == 200
     expect(res.body) == b'SecondLevelWithDefault.default'
示例#13
0
 def _(self):
     res = testApp.get('/withoutDefault')
     expect(res.status) == 200
     expect(res.body) == b'SiteRoot.default'
示例#14
0
 def _(_):
     res = testApp.get('/page_with_parameters')
     expect(res.status) == 200
     expect(res.body) == b'A'
示例#15
0
 def _(_):
     res = testApp.get('/html')
     expect(res.header('Content-Type')).should.startswith('text/html')
     expect(res.status) == 200
     expect(res.body) == b'HTML'
示例#16
0
 def _(_):
     res = testApp.get('/assert_get_request')
     expect(res.status) == 200
     expect(res.body) == b''
示例#17
0
 def _(_):
     res = testApp.get('/json')
     expect(res.header('Content-Type')).should.startswith('application/json')
     expect(res.status) == 200
     content = json.loads(res.body)
     expect(content) == 'JSON'
示例#18
0
 def _(_):
     expect(parseQuery("?"))  == web.Storage()
示例#19
0
 def _(_):
     res = testApp.get('/zipped_text_as_downloadable_file')
     expect(res.header('Content-Type')).should.startswith('application/text')
     expect(res.header('content-disposition')) == 'attachment;filename=myfile.csv'
     expect(res.status) == 200
     expect(unzipIt(res.body)) == b'zipped text file content'
示例#20
0
 def _(_):
     expect(parseQuery("?a=A"))  == web.Storage(a='A')
示例#21
0
 def _(self):
     res = testApp.get('/page')
     expect(res.status) == 200
     expect(res.body) == b'SiteRoot.page'